mirror of
https://github.com/XRPLF/rippled.git
synced 2026-06-07 18:56:47 +00:00
refactor: Enable clang-tidy readability-identifier-naming check (#6571)
This commit is contained in:
@@ -16,9 +16,9 @@
|
||||
namespace xrpl::test {
|
||||
|
||||
namespace validator_data {
|
||||
static auto const public_key = "nHBt9fsb4849WmZiCds4r5TXyBeQjqnH5kzPtqgMAQMgi39YZRPa";
|
||||
static auto const kPUBLIC_KEY = "nHBt9fsb4849WmZiCds4r5TXyBeQjqnH5kzPtqgMAQMgi39YZRPa";
|
||||
|
||||
static auto const token =
|
||||
static auto const kTOKEN =
|
||||
"eyJ2YWxpZGF0aW9uX3NlY3JldF9rZXkiOiI5ZWQ0NWY4NjYyNDFjYzE4YTI3NDdiNT\n"
|
||||
"QzODdjMDYyNTkwNzk3MmY0ZTcxOTAyMzFmYWE5Mzc0NTdmYTlkYWY2IiwibWFuaWZl\n"
|
||||
"c3QiOiJKQUFBQUFGeEllMUZ0d21pbXZHdEgyaUNjTUpxQzlnVkZLaWxHZncxL3ZDeE\n"
|
||||
@@ -29,7 +29,7 @@ static auto const token =
|
||||
"VUSmEydzBpMjFlcTNNWXl3TFZKWm5GT3I3QzBrdzJBaVR6U0NqSXpkaXRROD0ifQ==\n";
|
||||
} // namespace validator_data
|
||||
|
||||
class ServerInfo_test : public beast::unit_test::suite
|
||||
class ServerInfo_test : public beast::unit_test::Suite
|
||||
{
|
||||
public:
|
||||
static std::unique_ptr<Config>
|
||||
@@ -54,7 +54,8 @@ protocol = wss2
|
||||
admin = 127.0.0.1
|
||||
)xrpldConfig");
|
||||
|
||||
p->loadFromString(boost::str(toLoad % validator_data::token % validator_data::public_key));
|
||||
p->loadFromString(
|
||||
boost::str(toLoad % validator_data::kTOKEN % validator_data::kPUBLIC_KEY));
|
||||
|
||||
setupConfigForUnitTests(*p);
|
||||
|
||||
@@ -108,12 +109,12 @@ admin = 127.0.0.1
|
||||
Env env(*this, makeValidatorConfig());
|
||||
auto const& config = env.app().config();
|
||||
|
||||
auto const rpc_port = config["port_rpc"].get<unsigned int>("port");
|
||||
auto const grpc_port = config[SECTION_PORT_GRPC].get<unsigned int>("port");
|
||||
auto const ws_port = config["port_ws"].get<unsigned int>("port");
|
||||
BEAST_EXPECT(grpc_port);
|
||||
BEAST_EXPECT(rpc_port);
|
||||
BEAST_EXPECT(ws_port);
|
||||
auto const rpcPort = config["port_rpc"].get<unsigned int>("port");
|
||||
auto const grpcPort = config[SECTION_PORT_GRPC].get<unsigned int>("port");
|
||||
auto const wsPort = config["port_ws"].get<unsigned int>("port");
|
||||
BEAST_EXPECT(grpcPort);
|
||||
BEAST_EXPECT(rpcPort);
|
||||
BEAST_EXPECT(wsPort);
|
||||
|
||||
auto const result = env.rpc("server_info");
|
||||
BEAST_EXPECT(!result[jss::result].isMember(jss::error));
|
||||
@@ -121,7 +122,7 @@ admin = 127.0.0.1
|
||||
BEAST_EXPECT(result[jss::result].isMember(jss::info));
|
||||
BEAST_EXPECT(
|
||||
result[jss::result][jss::info][jss::pubkey_validator] ==
|
||||
validator_data::public_key);
|
||||
validator_data::kPUBLIC_KEY);
|
||||
|
||||
auto const& ports = result[jss::result][jss::info][jss::ports];
|
||||
BEAST_EXPECT(ports.isArray() && ports.size() == 3);
|
||||
@@ -130,19 +131,19 @@ admin = 127.0.0.1
|
||||
auto const& proto = port[jss::protocol];
|
||||
BEAST_EXPECT(proto.isArray());
|
||||
auto const p = port[jss::port].asUInt();
|
||||
BEAST_EXPECT(p == rpc_port || p == ws_port || p == grpc_port);
|
||||
if (p == grpc_port)
|
||||
BEAST_EXPECT(p == rpcPort || p == wsPort || p == grpcPort);
|
||||
if (p == grpcPort)
|
||||
{
|
||||
BEAST_EXPECT(proto.size() == 1);
|
||||
BEAST_EXPECT(proto[0u].asString() == "grpc");
|
||||
}
|
||||
if (p == rpc_port)
|
||||
if (p == rpcPort)
|
||||
{
|
||||
BEAST_EXPECT(proto.size() == 2);
|
||||
BEAST_EXPECT(proto[0u].asString() == "http");
|
||||
BEAST_EXPECT(proto[1u].asString() == "ws2");
|
||||
}
|
||||
if (p == ws_port)
|
||||
if (p == wsPort)
|
||||
{
|
||||
BEAST_EXPECT(proto.size() == 1);
|
||||
BEAST_EXPECT(proto[0u].asString() == "ws");
|
||||
|
||||
Reference in New Issue
Block a user