aboutsummaryrefslogtreecommitdiff
path: root/src/test/bech32_tests.cpp
diff options
context:
space:
mode:
authorSamuel Dobson <dobsonsa68@gmail.com>2021-12-04 12:49:27 +1300
committerSamuel Dobson <dobsonsa68@gmail.com>2021-12-06 14:17:41 +1300
commita4fe70171b6fa570eda71d86b59d0fb24c2f0614 (patch)
treef2039c5b04f96fe6a4b347a2dd8ee034198b0677 /src/test/bech32_tests.cpp
parent2fa4fd196176160a5ad0a25da173ff93252b8103 (diff)
downloadbitcoin-a4fe70171b6fa570eda71d86b59d0fb24c2f0614.tar.xz
Make Bech32 LocateErrors return error list rather than using out-arg
Diffstat (limited to 'src/test/bech32_tests.cpp')
-rw-r--r--src/test/bech32_tests.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/test/bech32_tests.cpp b/src/test/bech32_tests.cpp
index 5d851a9735..51a1d1199e 100644
--- a/src/test/bech32_tests.cpp
+++ b/src/test/bech32_tests.cpp
@@ -97,8 +97,7 @@ BOOST_AUTO_TEST_CASE(bech32_testvectors_invalid)
const auto& err = ERRORS[i];
const auto dec = bech32::Decode(str);
BOOST_CHECK(dec.encoding == bech32::Encoding::INVALID);
- std::vector<int> error_locations;
- std::string error = bech32::LocateErrors(str, error_locations);
+ auto [error, error_locations] = bech32::LocateErrors(str);
BOOST_CHECK_EQUAL(err.first, error);
BOOST_CHECK(err.second == error_locations);
i++;
@@ -150,8 +149,7 @@ BOOST_AUTO_TEST_CASE(bech32m_testvectors_invalid)
const auto& err = ERRORS[i];
const auto dec = bech32::Decode(str);
BOOST_CHECK(dec.encoding == bech32::Encoding::INVALID);
- std::vector<int> error_locations;
- std::string error = bech32::LocateErrors(str, error_locations);
+ auto [error, error_locations] = bech32::LocateErrors(str);
BOOST_CHECK_EQUAL(err.first, error);
BOOST_CHECK(err.second == error_locations);
i++;