From e3245f2e7b6f98cda38a3806da854f7d513fec2f Mon Sep 17 00:00:00 2001 From: 251 <13120787+251Labs@users.noreply.github.com> Date: Sun, 22 Jul 2018 21:34:45 +0200 Subject: Removes Boost predicate.hpp dependency This is a squashed commit that squashes the following commits: This commit removes the `boost/algorithm/string/predicate.hpp` dependenc from the project by replacing the function calls to `boost::algorithm::starts_with` `boost::algorithm::ends_with` and `all` with respectively C++11' `std::basic_string::front`, `std::basic_string::back`, `std::all_of` function calls This commit replaces `boost::algorithm::is_digit` with a locale independent isdigi function, because the use of the standard library's `isdigit` and `std::isdigit functions is discoraged in the developer notes --- src/test/util_tests.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/test') diff --git a/src/test/util_tests.cpp b/src/test/util_tests.cpp index d535f74e91..3661c762fc 100644 --- a/src/test/util_tests.cpp +++ b/src/test/util_tests.cpp @@ -806,6 +806,21 @@ BOOST_AUTO_TEST_CASE(gettime) BOOST_CHECK((GetTime() & ~0xFFFFFFFFLL) == 0); } +BOOST_AUTO_TEST_CASE(test_IsDigit) +{ + BOOST_CHECK_EQUAL(IsDigit('0'), true); + BOOST_CHECK_EQUAL(IsDigit('1'), true); + BOOST_CHECK_EQUAL(IsDigit('8'), true); + BOOST_CHECK_EQUAL(IsDigit('9'), true); + + BOOST_CHECK_EQUAL(IsDigit('0' - 1), false); + BOOST_CHECK_EQUAL(IsDigit('9' + 1), false); + BOOST_CHECK_EQUAL(IsDigit(0), false); + BOOST_CHECK_EQUAL(IsDigit(1), false); + BOOST_CHECK_EQUAL(IsDigit(8), false); + BOOST_CHECK_EQUAL(IsDigit(9), false); +} + BOOST_AUTO_TEST_CASE(test_ParseInt32) { int32_t n; -- cgit v1.2.3