Format first-party source according to .clang-format

This commit is contained in:
Pretty Printer
2020-04-17 09:56:34 -05:00
committed by manojsdoshi
parent 65dfc5d19e
commit 50760c6935
1076 changed files with 86161 additions and 77449 deletions

View File

@@ -17,31 +17,32 @@
*/
//==============================================================================
#include <test/jtx/envconfig.h>
#include <test/jtx/Env.h>
#include <ripple/core/ConfigSections.h>
#include <test/jtx/Env.h>
#include <test/jtx/envconfig.h>
namespace ripple {
namespace test {
int port_base = 8000;
void incPorts()
void
incPorts()
{
port_base += 3;
}
std::atomic<bool> envUseIPv4 {false};
std::atomic<bool> envUseIPv4{false};
void
setupConfigForUnitTests (Config& cfg)
setupConfigForUnitTests(Config& cfg)
{
std::string const port_peer = std::to_string(port_base);
std::string port_rpc = std::to_string(port_base + 1);
std::string port_ws = std::to_string(port_base + 2);
cfg.overwrite (ConfigSection::nodeDatabase (), "type", "memory");
cfg.overwrite (ConfigSection::nodeDatabase (), "path", "main");
cfg.deprecatedClearSection (ConfigSection::importNodeDatabase ());
cfg.overwrite(ConfigSection::nodeDatabase(), "type", "memory");
cfg.overwrite(ConfigSection::nodeDatabase(), "path", "main");
cfg.deprecatedClearSection(ConfigSection::importNodeDatabase());
cfg.legacy("database_path", "");
cfg.setupControl(true, true, true);
cfg["server"].append("port_peer");
@@ -68,8 +69,8 @@ namespace jtx {
std::unique_ptr<Config>
no_admin(std::unique_ptr<Config> cfg)
{
(*cfg)["port_rpc"].set("admin","");
(*cfg)["port_ws"].set("admin","");
(*cfg)["port_rpc"].set("admin", "");
(*cfg)["port_ws"].set("admin", "");
return cfg;
}
@@ -77,7 +78,7 @@ std::unique_ptr<Config>
secure_gateway(std::unique_ptr<Config> cfg)
{
(*cfg)["port_rpc"].set("admin", "");
(*cfg)["port_ws"].set("admin","");
(*cfg)["port_ws"].set("admin", "");
(*cfg)["port_rpc"].set("secure_gateway", getEnvLocalhostAddr());
return cfg;
}
@@ -88,8 +89,8 @@ std::unique_ptr<Config>
validator(std::unique_ptr<Config> cfg, std::string const& seed)
{
// If the config has valid validation keys then we run as a validator.
cfg->section(SECTION_VALIDATION_SEED).append(
std::vector<std::string>{seed.empty() ? defaultseed : seed});
cfg->section(SECTION_VALIDATION_SEED)
.append(std::vector<std::string>{seed.empty() ? defaultseed : seed});
return cfg;
}
@@ -102,7 +103,7 @@ port_increment(std::unique_ptr<Config> cfg, int increment)
auto const port = s.get<std::int32_t>("port");
if (port)
{
s.set ("port", std::to_string(*port + increment));
s.set("port", std::to_string(*port + increment));
}
}
return cfg;