]>
git.proxmox.com Git - ceph.git/blob - ceph/src/Beast/test/core/base64.cpp
2 // Copyright (c) 2013-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)
8 // Test that header file is self-contained.
9 #include <beast/core/detail/base64.hpp>
11 #include <beast/unit_test/suite.hpp>
16 class base64_test
: public beast::unit_test::suite
20 check (std::string
const& in
, std::string
const& out
)
22 auto const encoded
= base64_encode (in
);
23 BEAST_EXPECT(encoded
== out
);
24 BEAST_EXPECT(base64_decode (encoded
) == in
);
33 check ("foo", "Zm9v");
34 check ("foob", "Zm9vYg==");
35 check ("fooba", "Zm9vYmE=");
36 check ("foobar", "Zm9vYmFy");
40 BEAST_DEFINE_TESTSUITE(base64
,core
,beast
);