experimental-genesis 1
experimental-genesis 2
experimental-genesis 3
experimental-genesis 4
experimental-genesis 5
experimental-genesis 6
experimental-genesis 7
experimental-genesis 8
experimental-genesis 9
experimental-genesis 10
experimental-genesis 11
experimental-genesis 12
experimental-genesis 13
experimental-genesis 14
experimental-genesis 15
experimental-genesis 16
experimental-genesis 17
experimental-genesis 18
experimental-genesis 19
experimental-genesis 20
experimental-genesis 21
experimental-genesis 22
experimental-genesis 23
experimental-genesis 24
experimental-genesis 25
experimental-genesis 26
experimental-genesis 27
experimental-genesis 28
experimental-genesis 29
experimental-genesis 30
experimental-genesis 31
experimental-genesis 32 #include <boost/test/unit_test.hpp>
experimental-genesis 33
experimental-genesis 34 #include "../util.h"
experimental-genesis 35
experimental-genesis 36 BOOST_AUTO_TEST_SUITE(base64_tests)
experimental-genesis 37
experimental-genesis 38 BOOST_AUTO_TEST_CASE(base64_testvectors)
experimental-genesis 39 {
experimental-genesis 40 static const string vstrIn[] = {"","f","fo","foo","foob","fooba","foobar"};
experimental-genesis 41 static const string vstrOut[] = {"","Zg==","Zm8=","Zm9v","Zm9vYg==","Zm9vYmE=","Zm9vYmFy"};
experimental-genesis 42 for (int i=0; i<sizeof(vstrIn)/sizeof(vstrIn[0]); i++)
experimental-genesis 43 {
experimental-genesis 44 string strEnc = EncodeBase64(vstrIn[i]);
experimental-genesis 45 BOOST_CHECK(strEnc == vstrOut[i]);
experimental-genesis 46 string strDec = DecodeBase64(strEnc);
experimental-genesis 47 BOOST_CHECK(strDec == vstrIn[i]);
experimental-genesis 48 }
experimental-genesis 49 }
experimental-genesis 50
experimental-genesis 51 BOOST_AUTO_TEST_SUITE_END()