From a65931e3ce66d87b8f83d67ecdbb46f137e6a670 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Mon, 4 Apr 2022 13:19:49 -0400 Subject: Make DecodeBase{32,64} always return vector, not string Base32/base64 are mechanisms for encoding binary data. That they'd decode to a string is just bizarre. The fact that they'd do that based on the type of input arguments even more so. --- src/test/base32_tests.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/test/base32_tests.cpp') diff --git a/src/test/base32_tests.cpp b/src/test/base32_tests.cpp index 8a44e65165..2e5f6a2378 100644 --- a/src/test/base32_tests.cpp +++ b/src/test/base32_tests.cpp @@ -23,9 +23,9 @@ BOOST_AUTO_TEST_CASE(base32_testvectors) strEnc = EncodeBase32(vstrIn[i], false); BOOST_CHECK_EQUAL(strEnc, vstrOutNoPadding[i]); bool invalid; - std::string strDec = DecodeBase32(vstrOut[i], &invalid); + auto dec = DecodeBase32(vstrOut[i], &invalid); BOOST_CHECK(!invalid); - BOOST_CHECK_EQUAL(strDec, vstrIn[i]); + BOOST_CHECK_MESSAGE(MakeByteSpan(dec) == MakeByteSpan(vstrIn[i]), vstrOut[i]); } // Decoding strings with embedded NUL characters should fail -- cgit v1.2.3