-
+ D647D343641733DDF8D90510972D54CF8D9D5B6C5B18DC36D2DF0B4C125628DCD12EEC9E82B66FF6E3333C811B18DB84F47816D65A8CCA487ECD0276CCA581D9
bitcoin/src/test/base64_tests.cpp
(0 . 0)(1 . 20)
21324 #include <boost/test/unit_test.hpp>
21325
21326 #include "../util.h"
21327
21328 BOOST_AUTO_TEST_SUITE(base64_tests)
21329
21330 BOOST_AUTO_TEST_CASE(base64_testvectors)
21331 {
21332 static const string vstrIn[] = {"","f","fo","foo","foob","fooba","foobar"};
21333 static const string vstrOut[] = {"","Zg==","Zm8=","Zm9v","Zm9vYg==","Zm9vYmE=","Zm9vYmFy"};
21334 for (int i=0; i<sizeof(vstrIn)/sizeof(vstrIn[0]); i++)
21335 {
21336 string strEnc = EncodeBase64(vstrIn[i]);
21337 BOOST_CHECK(strEnc == vstrOut[i]);
21338 string strDec = DecodeBase64(strEnc);
21339 BOOST_CHECK(strDec == vstrIn[i]);
21340 }
21341 }
21342
21343 BOOST_AUTO_TEST_SUITE_END()