mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-28 06:55:50 +00:00
Tidy up core sources:
The core headers are moved to their own directory (but remain in the same namespace).
This commit is contained in:
44
test/core/detail/base64.cpp
Normal file
44
test/core/detail/base64.cpp
Normal file
@@ -0,0 +1,44 @@
|
||||
//
|
||||
// Copyright (c) 2013-2016 Vinnie Falco (vinnie dot falco at gmail dot com)
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
// Test that header file is self-contained.
|
||||
#include <beast/core/detail/base64.hpp>
|
||||
|
||||
#include <beast/unit_test/suite.hpp>
|
||||
|
||||
namespace beast {
|
||||
namespace detail {
|
||||
|
||||
class base64_test : public beast::unit_test::suite
|
||||
{
|
||||
public:
|
||||
void
|
||||
check (std::string const& in, std::string const& out)
|
||||
{
|
||||
auto const encoded = base64_encode (in);
|
||||
expect (encoded == out);
|
||||
expect (base64_decode (encoded) == in);
|
||||
}
|
||||
|
||||
void
|
||||
run()
|
||||
{
|
||||
check ("", "");
|
||||
check ("f", "Zg==");
|
||||
check ("fo", "Zm8=");
|
||||
check ("foo", "Zm9v");
|
||||
check ("foob", "Zm9vYg==");
|
||||
check ("fooba", "Zm9vYmE=");
|
||||
check ("foobar", "Zm9vYmFy");
|
||||
}
|
||||
};
|
||||
|
||||
BEAST_DEFINE_TESTSUITE(base64,core,beast);
|
||||
|
||||
} // detail
|
||||
} // beast
|
||||
|
||||
Reference in New Issue
Block a user