diff options
author | Jack Lloyd <[email protected]> | 2017-12-04 15:58:11 -0500 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2017-12-04 15:58:11 -0500 |
commit | e5f39dd483a08accc8a12e8b322a48037c5b3bf4 (patch) | |
tree | 6ae1dc30f1a8e8dea57eaa609b7af6b2fd0644af | |
parent | d3c1f3ba1a9d03ff8e84f0044ee3854804fac86b (diff) |
Better debug output in date conversion tests [ci skip]
-rw-r--r-- | src/tests/test_utils.cpp | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/src/tests/test_utils.cpp b/src/tests/test_utils.cpp index d102a3e46..b8df9c270 100644 --- a/src/tests/test_utils.cpp +++ b/src/tests/test_utils.cpp @@ -266,19 +266,20 @@ class Date_Format_Tests final : public Text_Based_Test Test::Result run_one_test(const std::string& type, const VarMap& vars) override { + const std::string date_str = get_req_str(vars, "Date"); Test::Result result("Date parsing"); - const std::vector<uint32_t> d = parse_date(get_req_str(vars, "Date")); + const std::vector<uint32_t> d = parse_date(date_str); 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("year", c.year, d[0]); - result.test_is_eq("month", c.month, d[1]); - result.test_is_eq("day", c.day, d[2]); - result.test_is_eq("hour", c.hour, d[3]); - result.test_is_eq("minute", c.minutes, d[4]); - result.test_is_eq("second", c.seconds, 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)) { @@ -287,12 +288,12 @@ class Date_Format_Tests final : public Text_Based_Test else { Botan::calendar_point c2 = Botan::calendar_value(c.to_std_timepoint()); - result.test_is_eq("year", c2.year, d[0]); - result.test_is_eq("month", c2.month, d[1]); - result.test_is_eq("day", c2.day, d[2]); - result.test_is_eq("hour", c2.hour, d[3]); - result.test_is_eq("minute", c2.minutes, d[4]); - result.test_is_eq("second", c2.seconds, d[5]); + 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]); } } else if(type == "invalid") |