-
+ 7B9C8BC0CA032326E19DB3610E5496671165ACC1273017558BE36E5B00DD202EAD3C6BA5C617832DE6A8A5E794C718DDB94577E4BECEE8FFCEAA224273B286CA
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()