MCPcopy Create free account
hub / github.com/ElementsProject/elements / BOOST_AUTO_TEST_CASE

Function BOOST_AUTO_TEST_CASE

src/test/bech32_tests.cpp:17–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15BOOST_AUTO_TEST_SUITE(bech32_tests)
16
17BOOST_AUTO_TEST_CASE(bech32_testvectors_valid)
18{
19 static const std::string CASES[] = {
20 "A12UEL5L",
21 "a12uel5l",
22 "an83characterlonghumanreadablepartthatcontainsthenumber1andtheexcludedcharactersbio1tt5tgs",
23 "abcdef1qpzry9x8gf2tvdw0s3jn54khce6mua7lmqqqxw",
24 "11qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqc8247j",
25 "split1checkupstagehandshakeupstreamerranterredcaperred2y9e3w",
26 "?1ezyfcl",
27 };
28 for (const std::string& str : CASES) {
29 const auto dec = bech32::Decode(str);
30 BOOST_CHECK(dec.encoding == bech32::Encoding::BECH32);
31 std::string recode = bech32::Encode(bech32::Encoding::BECH32, dec.hrp, dec.data);
32 BOOST_CHECK(!recode.empty());
33 BOOST_CHECK(CaseInsensitiveEqual(str, recode));
34 }
35}
36
37BOOST_AUTO_TEST_CASE(bech32m_testvectors_valid)
38{

Callers

nothing calls this directly

Calls 13

CaseInsensitiveEqualFunction · 0.85
LocateErrorsFunction · 0.85
GetRandBytesFunction · 0.85
DecodeFunction · 0.50
EncodeFunction · 0.50
sizeFunction · 0.50
PolyModFunction · 0.50
emptyMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45
push_backMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected