From 0cfbd04bb5169d9c4423c20ed90cf194891949ce Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Fri, 27 Aug 2021 19:58:59 +0100 Subject: Test mod100_extract --- test/test-misc.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'test') diff --git a/test/test-misc.cpp b/test/test-misc.cpp index 515a9c7..c72f3a6 100644 --- a/test/test-misc.cpp +++ b/test/test-misc.cpp @@ -99,3 +99,16 @@ BOOST_AUTO_TEST_CASE(create_datetime) MyGrate::DateTime dt {tm}; BOOST_CHECK_EQUAL(dt, (MyGrate::DateTime {2021, 8, 17, 17, 44, 49})); } + +BOOST_AUTO_TEST_CASE(mod100_extract) +{ + long unsigned int i {1629222289}; + BOOST_CHECK_EQUAL((int)MyGrate::mod100_extract(i), 89); + BOOST_CHECK_EQUAL((int)MyGrate::mod100_extract(i), 22); + BOOST_CHECK_EQUAL((int)MyGrate::mod100_extract(i), 22); + BOOST_CHECK_EQUAL((int)MyGrate::mod100_extract(i), 29); + BOOST_CHECK_EQUAL((int)MyGrate::mod100_extract(i), 16); + BOOST_CHECK_EQUAL((int)MyGrate::mod100_extract(i), 0); + BOOST_CHECK_EQUAL((int)MyGrate::mod100_extract(i), 0); + BOOST_CHECK_EQUAL((int)MyGrate::mod100_extract(i), 0); +} -- cgit v1.2.3