]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/beast/test/beast/core/detail/base64.cpp
2 // Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com)
4 // Distributed under the Boost Software License, Version 1.0. (See accompanying
5 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7 // Official repository: https://github.com/boostorg/beast
10 // Test that header file is self-contained.
11 #include <boost/beast/core/detail/base64.hpp>
13 #include <boost/beast/unit_test/suite.hpp>
19 class base64_test
: public beast::unit_test::suite
23 check (std::string
const& in
, std::string
const& out
)
25 auto const encoded
= base64_encode (in
);
26 BEAST_EXPECT(encoded
== out
);
27 BEAST_EXPECT(base64_decode (encoded
) == in
);
36 check ("foo", "Zm9v");
37 check ("foob", "Zm9vYg==");
38 check ("fooba", "Zm9vYmE=");
39 check ("foobar", "Zm9vYmFy");
42 "Man is distinguished, not only by his reason, but by this singular passion from "
43 "other animals, which is a lust of the mind, that by a perseverance of delight "
44 "in the continued and indefatigable generation of knowledge, exceeds the short "
45 "vehemence of any carnal pleasure."
47 "TWFuIGlzIGRpc3Rpbmd1aXNoZWQsIG5vdCBvbmx5IGJ5IGhpcyByZWFzb24sIGJ1dCBieSB0aGlz"
48 "IHNpbmd1bGFyIHBhc3Npb24gZnJvbSBvdGhlciBhbmltYWxzLCB3aGljaCBpcyBhIGx1c3Qgb2Yg"
49 "dGhlIG1pbmQsIHRoYXQgYnkgYSBwZXJzZXZlcmFuY2Ugb2YgZGVsaWdodCBpbiB0aGUgY29udGlu"
50 "dWVkIGFuZCBpbmRlZmF0aWdhYmxlIGdlbmVyYXRpb24gb2Yga25vd2xlZGdlLCBleGNlZWRzIHRo"
51 "ZSBzaG9ydCB2ZWhlbWVuY2Ugb2YgYW55IGNhcm5hbCBwbGVhc3VyZS4="
56 BEAST_DEFINE_TESTSUITE(beast
,core
,base64
);