diff options
Diffstat (limited to 'src/tests/test_utils.cpp')
-rw-r--r-- | src/tests/test_utils.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/tests/test_utils.cpp b/src/tests/test_utils.cpp index b8df9c270..3c4accab2 100644 --- a/src/tests/test_utils.cpp +++ b/src/tests/test_utils.cpp @@ -274,26 +274,26 @@ class Date_Format_Tests final : public Text_Based_Test if(type == "valid" || type == "valid.not_std" || type == "valid.64_bit_time_t") { Botan::calendar_point c(d[0], d[1], d[2], d[3], d[4], d[5]); - result.test_is_eq(date_str + " year", c.year, d[0]); - result.test_is_eq(date_str + " month", c.month, d[1]); - result.test_is_eq(date_str + " day", c.day, d[2]); - result.test_is_eq(date_str + " hour", c.hour, d[3]); - result.test_is_eq(date_str + " minute", c.minutes, d[4]); - result.test_is_eq(date_str + " second", c.seconds, d[5]); - - if(type == "valid.not_std" || (type == "valid.64_bit_time_t" && c.year > 2037 && sizeof(std::time_t) == 4)) + result.test_is_eq(date_str + " year", c.get_year(), d[0]); + result.test_is_eq(date_str + " month", c.get_month(), d[1]); + result.test_is_eq(date_str + " day", c.get_day(), d[2]); + result.test_is_eq(date_str + " hour", c.get_hour(), d[3]); + result.test_is_eq(date_str + " minute", c.get_minutes(), d[4]); + result.test_is_eq(date_str + " second", c.get_seconds(), d[5]); + + if(type == "valid.not_std" || (type == "valid.64_bit_time_t" && c.get_year() > 2037 && sizeof(std::time_t) == 4)) { result.test_throws("valid but out of std::timepoint range", [c]() { c.to_std_timepoint(); }); } else { Botan::calendar_point c2 = Botan::calendar_value(c.to_std_timepoint()); - result.test_is_eq(date_str + " year", c2.year, d[0]); - result.test_is_eq(date_str + " month", c2.month, d[1]); - result.test_is_eq(date_str + " day", c2.day, d[2]); - result.test_is_eq(date_str + " hour", c2.hour, d[3]); - result.test_is_eq(date_str + " minute", c2.minutes, d[4]); - result.test_is_eq(date_str + " second", c2.seconds, d[5]); + result.test_is_eq(date_str + " year", c2.get_year(), d[0]); + result.test_is_eq(date_str + " month", c2.get_month(), d[1]); + result.test_is_eq(date_str + " day", c2.get_day(), d[2]); + result.test_is_eq(date_str + " hour", c2.get_hour(), d[3]); + result.test_is_eq(date_str + " minute", c2.get_minutes(), d[4]); + result.test_is_eq(date_str + " second", c2.get_seconds(), d[5]); } } else if(type == "invalid") |