mirror of
https://github.com/XRPLF/rippled.git
synced 2026-09-27 23:38:08 +00:00
Move all detail namespaces to be under ripple
- Avoids problems with namespace collisions / ambiguous symbol issues with unity builds, especially when adding or removing files.
This commit is contained in:
@@ -37,7 +37,6 @@
|
||||
#include <chrono>
|
||||
|
||||
namespace ripple {
|
||||
namespace test {
|
||||
namespace detail {
|
||||
constexpr const char*
|
||||
realValidatorContents()
|
||||
@@ -56,6 +55,7 @@ auto constexpr default_expires = std::chrono::seconds{3600};
|
||||
auto constexpr default_effective_overlap = std::chrono::seconds{30};
|
||||
} // namespace detail
|
||||
|
||||
namespace test {
|
||||
class ValidatorSite_test : public beast::unit_test::suite
|
||||
{
|
||||
private:
|
||||
|
||||
@@ -31,7 +31,7 @@ public:
|
||||
void
|
||||
testGetFileContents()
|
||||
{
|
||||
using namespace ripple::test::detail;
|
||||
using namespace ripple::detail;
|
||||
using namespace boost::system;
|
||||
|
||||
constexpr const char* expectedContents =
|
||||
|
||||
@@ -128,7 +128,7 @@ backend=sqlite
|
||||
/**
|
||||
Write a rippled config file and remove when done.
|
||||
*/
|
||||
class RippledCfgGuard : public ripple::test::detail::FileDirGuard
|
||||
class RippledCfgGuard : public ripple::detail::FileDirGuard
|
||||
{
|
||||
private:
|
||||
path dataDir_;
|
||||
@@ -239,7 +239,7 @@ moreripplevalidators.net
|
||||
/**
|
||||
Write a validators.txt file and remove when done.
|
||||
*/
|
||||
class ValidatorsTxtGuard : public test::detail::FileDirGuard
|
||||
class ValidatorsTxtGuard : public detail::FileDirGuard
|
||||
{
|
||||
public:
|
||||
ValidatorsTxtGuard(
|
||||
@@ -345,7 +345,7 @@ port_wss_admin
|
||||
{
|
||||
// read from file absolute path
|
||||
auto const cwd = current_path();
|
||||
ripple::test::detail::DirGuard const g0(*this, "test_db");
|
||||
ripple::detail::DirGuard const g0(*this, "test_db");
|
||||
path const dataDirRel("test_data_dir");
|
||||
path const dataDirAbs(cwd / g0.subdir() / dataDirRel);
|
||||
detail::RippledCfgGuard const g(
|
||||
|
||||
@@ -30,9 +30,6 @@
|
||||
#include <unordered_map>
|
||||
|
||||
namespace ripple {
|
||||
namespace test {
|
||||
namespace csf {
|
||||
|
||||
namespace detail {
|
||||
// Dummy class when no edge data needed for graph
|
||||
struct NoEdgeData
|
||||
@@ -41,6 +38,9 @@ struct NoEdgeData
|
||||
|
||||
} // namespace detail
|
||||
|
||||
namespace test {
|
||||
namespace csf {
|
||||
|
||||
/** Directed graph
|
||||
|
||||
Basic directed graph that uses an adjacency list to represent out edges.
|
||||
|
||||
@@ -34,6 +34,16 @@
|
||||
#include <type_traits>
|
||||
|
||||
namespace ripple {
|
||||
|
||||
namespace detail {
|
||||
|
||||
struct epsilon_multiple
|
||||
{
|
||||
std::size_t n;
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
|
||||
namespace test {
|
||||
namespace jtx {
|
||||
|
||||
@@ -312,15 +322,6 @@ drops(XRPAmount i)
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace detail {
|
||||
|
||||
struct epsilon_multiple
|
||||
{
|
||||
std::size_t n;
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
|
||||
// The smallest possible IOU STAmount
|
||||
struct epsilon_t
|
||||
{
|
||||
|
||||
@@ -27,22 +27,6 @@
|
||||
#include <xrpl/protocol/TxFlags.h>
|
||||
|
||||
namespace ripple {
|
||||
namespace test {
|
||||
namespace jtx {
|
||||
|
||||
// JSON generators
|
||||
|
||||
/** Add and/or remove flag. */
|
||||
Json::Value
|
||||
fset(Account const& account, std::uint32_t on, std::uint32_t off = 0);
|
||||
|
||||
/** Remove account flag. */
|
||||
inline Json::Value
|
||||
fclear(Account const& account, std::uint32_t off)
|
||||
{
|
||||
return fset(account, 0, off);
|
||||
}
|
||||
|
||||
namespace detail {
|
||||
|
||||
class flags_helper
|
||||
@@ -108,6 +92,22 @@ protected:
|
||||
|
||||
} // namespace detail
|
||||
|
||||
namespace test {
|
||||
namespace jtx {
|
||||
|
||||
// JSON generators
|
||||
|
||||
/** Add and/or remove flag. */
|
||||
Json::Value
|
||||
fset(Account const& account, std::uint32_t on, std::uint32_t off = 0);
|
||||
|
||||
/** Remove account flag. */
|
||||
inline Json::Value
|
||||
fclear(Account const& account, std::uint32_t off)
|
||||
{
|
||||
return fset(account, 0, off);
|
||||
}
|
||||
|
||||
/** Match set account flags */
|
||||
class flags : private detail::flags_helper
|
||||
{
|
||||
|
||||
@@ -20,9 +20,6 @@
|
||||
#include <test/jtx/owners.h>
|
||||
|
||||
namespace ripple {
|
||||
namespace test {
|
||||
namespace jtx {
|
||||
|
||||
namespace detail {
|
||||
|
||||
std::uint32_t
|
||||
@@ -39,7 +36,7 @@ owned_count_of(ReadView const& view, AccountID const& id, LedgerEntryType type)
|
||||
|
||||
void
|
||||
owned_count_helper(
|
||||
Env& env,
|
||||
test::jtx::Env& env,
|
||||
AccountID const& id,
|
||||
LedgerEntryType type,
|
||||
std::uint32_t value)
|
||||
@@ -49,6 +46,9 @@ owned_count_helper(
|
||||
|
||||
} // namespace detail
|
||||
|
||||
namespace test {
|
||||
namespace jtx {
|
||||
|
||||
void
|
||||
owners::operator()(Env& env) const
|
||||
{
|
||||
|
||||
@@ -30,8 +30,6 @@
|
||||
#include <cstdint>
|
||||
|
||||
namespace ripple {
|
||||
namespace test {
|
||||
namespace jtx {
|
||||
|
||||
namespace detail {
|
||||
|
||||
@@ -40,13 +38,16 @@ owned_count_of(ReadView const& view, AccountID const& id, LedgerEntryType type);
|
||||
|
||||
void
|
||||
owned_count_helper(
|
||||
Env& env,
|
||||
test::jtx::Env& env,
|
||||
AccountID const& id,
|
||||
LedgerEntryType type,
|
||||
std::uint32_t value);
|
||||
|
||||
} // namespace detail
|
||||
|
||||
namespace test {
|
||||
namespace jtx {
|
||||
|
||||
// Helper for aliases
|
||||
template <LedgerEntryType Type>
|
||||
class owner_count
|
||||
|
||||
@@ -26,14 +26,12 @@
|
||||
#include <vector>
|
||||
|
||||
namespace ripple {
|
||||
namespace test {
|
||||
namespace jtx {
|
||||
|
||||
namespace detail {
|
||||
|
||||
template <class Cond, class... Args>
|
||||
inline void
|
||||
require_args(requires_t& vec, Cond const& cond, Args const&... args)
|
||||
require_args(test::jtx::requires_t& vec, Cond const& cond, Args const&... args)
|
||||
{
|
||||
vec.push_back(cond);
|
||||
if constexpr (sizeof...(args) > 0)
|
||||
@@ -42,6 +40,9 @@ require_args(requires_t& vec, Cond const& cond, Args const&... args)
|
||||
|
||||
} // namespace detail
|
||||
|
||||
namespace test {
|
||||
namespace jtx {
|
||||
|
||||
/** Compose many condition functors into one */
|
||||
template <class... Args>
|
||||
require_t
|
||||
|
||||
@@ -61,7 +61,6 @@ multi(32gb):
|
||||
*/
|
||||
|
||||
namespace ripple {
|
||||
namespace NodeStore {
|
||||
|
||||
namespace detail {
|
||||
|
||||
@@ -191,6 +190,8 @@ fmtdur(std::chrono::duration<Period, Rep> const& d)
|
||||
|
||||
} // namespace detail
|
||||
|
||||
namespace NodeStore {
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
class progress
|
||||
|
||||
@@ -27,7 +27,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
#include <boost/filesystem.hpp>
|
||||
|
||||
namespace ripple {
|
||||
namespace test {
|
||||
|
||||
namespace detail {
|
||||
|
||||
/**
|
||||
@@ -176,7 +176,6 @@ public:
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
} // namespace test
|
||||
} // namespace ripple
|
||||
|
||||
#endif // TEST_UNIT_TEST_DIRGUARD_H
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
#include <vector>
|
||||
|
||||
namespace ripple {
|
||||
namespace test {
|
||||
|
||||
namespace detail {
|
||||
|
||||
@@ -388,6 +387,8 @@ multi_runner_base<IsParent>::add_failures(std::size_t failures)
|
||||
|
||||
} // namespace detail
|
||||
|
||||
namespace test {
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
multi_runner_parent::multi_runner_parent() : os_(std::cout)
|
||||
@@ -645,10 +646,11 @@ multi_runner_child::on_log(std::string const& msg)
|
||||
message_queue_send(MessageType::log, s.str());
|
||||
}
|
||||
|
||||
} // namespace test
|
||||
|
||||
namespace detail {
|
||||
template class multi_runner_base<true>;
|
||||
template class multi_runner_base<false>;
|
||||
} // namespace detail
|
||||
|
||||
} // namespace test
|
||||
} // namespace ripple
|
||||
|
||||
@@ -40,7 +40,6 @@
|
||||
#include <utility>
|
||||
|
||||
namespace ripple {
|
||||
namespace test {
|
||||
|
||||
namespace detail {
|
||||
|
||||
@@ -212,6 +211,8 @@ public:
|
||||
|
||||
} // namespace detail
|
||||
|
||||
namespace test {
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/** Manager for children running unit tests
|
||||
|
||||
Reference in New Issue
Block a user