JayBeams
0.1
Another project to have fun coding.
jb
itch5
ut_static_digits.cpp
Go to the documentation of this file.
1
#include <
jb/itch5/static_digits.hpp
>
2
3
#include <boost/test/unit_test.hpp>
4
5
/**
6
* @test Verify that jb::itch5::static_digits works as expected.
7
*/
8
BOOST_AUTO_TEST_CASE
(
static_digits
) {
9
BOOST_CHECK_EQUAL(
jb::itch5::static_digits
(0), 1);
10
BOOST_CHECK_EQUAL(
jb::itch5::static_digits
(5), 1);
11
BOOST_CHECK_EQUAL(
jb::itch5::static_digits
(9), 1);
12
BOOST_CHECK_EQUAL(
jb::itch5::static_digits
(10), 2);
13
BOOST_CHECK_EQUAL(
jb::itch5::static_digits
(99), 2);
14
BOOST_CHECK_EQUAL(
jb::itch5::static_digits
(1000), 4);
15
BOOST_CHECK_EQUAL(
jb::itch5::static_digits
(5000000), 7);
16
}
jb::itch5::static_digits
constexpr int static_digits(std::intmax_t value)
Compute (at compile time if possible) the number of digits in a number.
Definition:
static_digits.hpp:11
BOOST_AUTO_TEST_CASE
BOOST_AUTO_TEST_CASE(static_digits)
Definition:
ut_static_digits.cpp:8
static_digits.hpp
Generated by
1.8.13