aboutsummaryrefslogtreecommitdiff
path: root/src/test/base32_tests.cpp
diff options
context:
space:
mode:
authorVasil Dimov <vd@FreeBSD.org>2020-08-27 11:03:21 +0200
committerVasil Dimov <vd@FreeBSD.org>2020-09-21 10:13:34 +0200
commit7be6ff61875a8d5d2335bff5d1f16ba40557adb0 (patch)
treea2c60b8c3ad2144f697f334c05b6f6a508743459 /src/test/base32_tests.cpp
parente0d73573a37bf4b519f6f61e5678572d48a64517 (diff)
net: recognize TORv3/I2P/CJDNS networks
Recognizing addresses from those networks allows us to accept and gossip them, even though we don't know how to connect to them (yet). Co-authored-by: eriknylund <erik@daychanged.com>
Diffstat (limited to 'src/test/base32_tests.cpp')
-rw-r--r--src/test/base32_tests.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/test/base32_tests.cpp b/src/test/base32_tests.cpp
index eedab30576..d519eca859 100644
--- a/src/test/base32_tests.cpp
+++ b/src/test/base32_tests.cpp
@@ -13,10 +13,13 @@ BOOST_AUTO_TEST_CASE(base32_testvectors)
{
static const std::string vstrIn[] = {"","f","fo","foo","foob","fooba","foobar"};
static const std::string vstrOut[] = {"","my======","mzxq====","mzxw6===","mzxw6yq=","mzxw6ytb","mzxw6ytboi======"};
+ static const std::string vstrOutNoPadding[] = {"","my","mzxq","mzxw6","mzxw6yq","mzxw6ytb","mzxw6ytboi"};
for (unsigned int i=0; i<sizeof(vstrIn)/sizeof(vstrIn[0]); i++)
{
std::string strEnc = EncodeBase32(vstrIn[i]);
BOOST_CHECK_EQUAL(strEnc, vstrOut[i]);
+ strEnc = EncodeBase32(vstrIn[i], false);
+ BOOST_CHECK_EQUAL(strEnc, vstrOutNoPadding[i]);
std::string strDec = DecodeBase32(vstrOut[i]);
BOOST_CHECK_EQUAL(strDec, vstrIn[i]);
}