| 37 | |
| 38 | // Goal: test low-level base58 encoding functionality |
| 39 | BOOST_AUTO_TEST_CASE(base58_EncodeBase58) |
| 40 | { |
| 41 | Array tests = read_json(std::string(json_tests::base58_encode_decode, json_tests::base58_encode_decode + sizeof(json_tests::base58_encode_decode))); |
| 42 | for (auto& tv : tests) |
| 43 | { |
| 44 | Array test = tv.get_array(); |
| 45 | std::string strTest = write_string(tv, false); |
| 46 | if (test.size() < 2) // Allow for extra stuff (useful for comments) |
| 47 | { |
| 48 | BOOST_ERROR("Bad test: " << strTest); |
| 49 | continue; |
| 50 | } |
| 51 | std::vector<unsigned char> sourcedata = ParseHex(test[0].get_str()); |
| 52 | std::string base58string = test[1].get_str(); |
| 53 | BOOST_CHECK_MESSAGE( |
| 54 | EncodeBase58(&sourcedata[0], &sourcedata[sourcedata.size()]) == base58string, |
| 55 | strTest); |
| 56 | } |
| 57 | } |
| 58 | |
| 59 | // Goal: test low-level base58 decoding functionality |
| 60 | BOOST_AUTO_TEST_CASE(base58_DecodeBase58) |
nothing calls this directly
no test coverage detected