From 6fdb82fa7f196173589ca281642ddc6ac6961005 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Fri, 27 Aug 2021 20:10:32 +0100 Subject: Extract and test time2From24bit --- test/test-misc.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'test') diff --git a/test/test-misc.cpp b/test/test-misc.cpp index c72f3a6..6452050 100644 --- a/test/test-misc.cpp +++ b/test/test-misc.cpp @@ -1,11 +1,14 @@ #define BOOST_TEST_MODULE BitSet +#include #include #include #include #include #include +#include #include +#include #include #include #include @@ -112,3 +115,22 @@ BOOST_AUTO_TEST_CASE(mod100_extract) BOOST_CHECK_EQUAL((int)MyGrate::mod100_extract(i), 0); BOOST_CHECK_EQUAL((int)MyGrate::mod100_extract(i), 0); } + +using ConvertTimeData = std::tuple; +BOOST_DATA_TEST_CASE(convert_time, + boost::unit_test::data::make({ + {0x8128cc00, {18, 35, 12}}, + {0x81537500, {21, 13, 53}}, + {0x817d2200, {23, 52, 34}}, + {0x8027cf00, {2, 31, 15}}, + {0x80527800, {5, 9, 56}}, + {0x807c2500, {7, 48, 37}}, + {0x80a6d200, {10, 27, 18}}, + {0x80d17b00, {13, 5, 59}}, + {0x80fb2800, {15, 44, 40}}, + {0x8125d500, {18, 23, 21}}, + }), + tint, time) +{ + BOOST_CHECK_EQUAL(MyGrate::MySQL::time2From24bit(tint), time); +} -- cgit v1.2.3