summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2021-08-27 19:58:59 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2021-08-27 19:58:59 +0100
commit0cfbd04bb5169d9c4423c20ed90cf194891949ce (patch)
treef54298c9e0927f1ee80fa6eec39d177cc2b3090a /test
parentMake date/time types easy to create and compare (diff)
downloadmygrate-0cfbd04bb5169d9c4423c20ed90cf194891949ce.tar.bz2
mygrate-0cfbd04bb5169d9c4423c20ed90cf194891949ce.tar.xz
mygrate-0cfbd04bb5169d9c4423c20ed90cf194891949ce.zip
Test mod100_extract
Diffstat (limited to 'test')
-rw-r--r--test/test-misc.cpp13
1 files changed, 13 insertions, 0 deletions
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);
+}