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

Function BOOST_AUTO_TEST_CASE

src/test/blech32_tests.cpp:15–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13BOOST_AUTO_TEST_SUITE(blech32_tests)
14
15BOOST_AUTO_TEST_CASE(blech32_testvectors_valid)
16{
17 static const std::string CASES[] = {
18 "A133NZFWEYK7UT",
19 "a133nzfweyk7ut",
20 "an83characterlonghumanreadablepartthatcontainsthenumber1andtheexcludedcharactersbio195jhgldwsn5j",
21 "abcdef1qpzry9x8gf2tvdw0s3jn54khce6mua7lgmcn7l7t7xve",
22 "11qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq3xldwlutcw2l",
23 "split1checkupstagehandshakeupstreamerranterredcaperredegneyqml9esp",
24 "?19dv34t3p4s35",
25 };
26 for (const std::string& str : CASES) {
27 const auto dec = blech32::Decode(str);
28 BOOST_CHECK(dec.encoding == blech32::Encoding::BLECH32);
29 std::string recode = blech32::Encode(blech32::Encoding::BLECH32, dec.hrp, dec.data);
30 BOOST_CHECK(!recode.empty());
31 BOOST_CHECK(CaseInsensitiveEqual(str, recode));
32 }
33}
34
35BOOST_AUTO_TEST_CASE(blech32m_testvectors_valid)
36{

Callers

nothing calls this directly

Calls 12

CaseInsensitiveEqualFunction · 0.85
GetRandBytesFunction · 0.85
DecodeFunction · 0.50
EncodeFunction · 0.50
PolyModFunction · 0.50
CreateChecksumFunction · 0.50
emptyMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45
push_backMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected