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.cpp19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/test/util_tests.cpp b/src/test/util_tests.cpp
index 8c8b99e1b2..94c0c77a44 100644
--- a/src/test/util_tests.cpp
+++ b/src/test/util_tests.cpp
@@ -2,7 +2,9 @@
#include <boost/test/unit_test.hpp>
#include <boost/foreach.hpp>
-#include "../util.h"
+#include "main.h"
+#include "wallet.h"
+#include "util.h"
using namespace std;
@@ -230,4 +232,19 @@ BOOST_AUTO_TEST_CASE(util_ParseMoney)
BOOST_CHECK(!ParseMoney("92233720368.54775808", ret));
}
+BOOST_AUTO_TEST_CASE(util_IsHex)
+{
+ BOOST_CHECK(IsHex("00"));
+ BOOST_CHECK(IsHex("00112233445566778899aabbccddeeffAABBCCDDEEFF"));
+ BOOST_CHECK(IsHex("ff"));
+ BOOST_CHECK(IsHex("FF"));
+
+ BOOST_CHECK(!IsHex(""));
+ BOOST_CHECK(!IsHex("0"));
+ BOOST_CHECK(!IsHex("a"));
+ BOOST_CHECK(!IsHex("eleven"));
+ BOOST_CHECK(!IsHex("00xx00"));
+ BOOST_CHECK(!IsHex("0x0000"));
+}
+
BOOST_AUTO_TEST_SUITE_END()