aboutsummaryrefslogtreecommitdiff
path: root/src/test/util_tests.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/util_tests.cpp')
-rw-r--r--src/test/util_tests.cpp15
1 files changed, 15 insertions, 0 deletions
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;