mirror of
https://github.com/XRPLF/clio.git
synced 2025-12-05 08:48:13 +00:00
[CI] clang-tidy auto fixes (#1478)
Fixes #1477. Please review and commit clang-tidy fixes. Co-authored-by: kuznetsss <kuznetsss@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
0cdc24023f
commit
bdb72f91a2
@@ -18,7 +18,6 @@
|
|||||||
//==============================================================================
|
//==============================================================================
|
||||||
|
|
||||||
#include "etl/impl/SubscriptionSource.hpp"
|
#include "etl/impl/SubscriptionSource.hpp"
|
||||||
#include "util/AssignRandomPort.hpp"
|
|
||||||
#include "util/Fixtures.hpp"
|
#include "util/Fixtures.hpp"
|
||||||
#include "util/MockNetworkValidatedLedgers.hpp"
|
#include "util/MockNetworkValidatedLedgers.hpp"
|
||||||
#include "util/MockSubscriptionManager.hpp"
|
#include "util/MockSubscriptionManager.hpp"
|
||||||
@@ -32,7 +31,6 @@
|
|||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
|
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <cstdint>
|
|
||||||
#include <optional>
|
#include <optional>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|||||||
@@ -32,7 +32,6 @@
|
|||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
|
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <cstdint>
|
|
||||||
#include <expected>
|
#include <expected>
|
||||||
#include <optional>
|
#include <optional>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|||||||
@@ -17,7 +17,6 @@
|
|||||||
*/
|
*/
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
|
|
||||||
#include "util/AssignRandomPort.hpp"
|
|
||||||
#include "util/Fixtures.hpp"
|
#include "util/Fixtures.hpp"
|
||||||
#include "util/TestWsServer.hpp"
|
#include "util/TestWsServer.hpp"
|
||||||
#include "util/requests/Types.hpp"
|
#include "util/requests/Types.hpp"
|
||||||
@@ -30,7 +29,6 @@
|
|||||||
|
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <cstdint>
|
|
||||||
#include <expected>
|
#include <expected>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <optional>
|
#include <optional>
|
||||||
|
|||||||
@@ -44,11 +44,9 @@
|
|||||||
#include <fmt/core.h>
|
#include <fmt/core.h>
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
|
|
||||||
#include <chrono>
|
|
||||||
#include <condition_variable>
|
#include <condition_variable>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <iostream>
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
#include <optional>
|
#include <optional>
|
||||||
@@ -518,7 +516,7 @@ TEST_P(WebServerAdminTest, WsAdminCheck)
|
|||||||
Config const serverConfig{parse(GetParam().config)};
|
Config const serverConfig{parse(GetParam().config)};
|
||||||
auto server = makeServerSync(serverConfig, ctx, std::nullopt, dosGuardOverload, e);
|
auto server = makeServerSync(serverConfig, ctx, std::nullopt, dosGuardOverload, e);
|
||||||
WebSocketSyncClient wsClient;
|
WebSocketSyncClient wsClient;
|
||||||
uint32_t webServerPort = serverConfig.value<uint32_t>("server.port");
|
uint32_t const webServerPort = serverConfig.value<uint32_t>("server.port");
|
||||||
wsClient.connect("localhost", std::to_string(webServerPort), GetParam().headers);
|
wsClient.connect("localhost", std::to_string(webServerPort), GetParam().headers);
|
||||||
std::string const request = "Why hello";
|
std::string const request = "Why hello";
|
||||||
auto const res = wsClient.syncPost(request);
|
auto const res = wsClient.syncPost(request);
|
||||||
@@ -532,7 +530,7 @@ TEST_P(WebServerAdminTest, HttpAdminCheck)
|
|||||||
Config const serverConfig{parse(GetParam().config)};
|
Config const serverConfig{parse(GetParam().config)};
|
||||||
auto server = makeServerSync(serverConfig, ctx, std::nullopt, dosGuardOverload, e);
|
auto server = makeServerSync(serverConfig, ctx, std::nullopt, dosGuardOverload, e);
|
||||||
std::string const request = "Why hello";
|
std::string const request = "Why hello";
|
||||||
uint32_t webServerPort = serverConfig.value<uint32_t>("server.port");
|
uint32_t const webServerPort = serverConfig.value<uint32_t>("server.port");
|
||||||
auto const res = HttpSyncClient::syncPost("localhost", std::to_string(webServerPort), request, GetParam().headers);
|
auto const res = HttpSyncClient::syncPost("localhost", std::to_string(webServerPort), request, GetParam().headers);
|
||||||
EXPECT_EQ(res, fmt::format("{} {}", request, GetParam().expectedResponse));
|
EXPECT_EQ(res, fmt::format("{} {}", request, GetParam().expectedResponse));
|
||||||
}
|
}
|
||||||
@@ -607,7 +605,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||||||
TEST_F(WebServerTest, AdminErrorCfgTestBothAdminPasswordAndLocalAdminSet)
|
TEST_F(WebServerTest, AdminErrorCfgTestBothAdminPasswordAndLocalAdminSet)
|
||||||
{
|
{
|
||||||
uint32_t webServerPort = tests::util::generateFreePort();
|
uint32_t webServerPort = tests::util::generateFreePort();
|
||||||
std::string JSONServerConfigWithBothAdminPasswordAndLocalAdmin = fmt::format(
|
std::string const JSONServerConfigWithBothAdminPasswordAndLocalAdmin = fmt::format(
|
||||||
R"JSON({{
|
R"JSON({{
|
||||||
"server":{{
|
"server":{{
|
||||||
"ip": "0.0.0.0",
|
"ip": "0.0.0.0",
|
||||||
@@ -627,7 +625,7 @@ TEST_F(WebServerTest, AdminErrorCfgTestBothAdminPasswordAndLocalAdminSet)
|
|||||||
TEST_F(WebServerTest, AdminErrorCfgTestBothAdminPasswordAndLocalAdminFalse)
|
TEST_F(WebServerTest, AdminErrorCfgTestBothAdminPasswordAndLocalAdminFalse)
|
||||||
{
|
{
|
||||||
uint32_t webServerPort = tests::util::generateFreePort();
|
uint32_t webServerPort = tests::util::generateFreePort();
|
||||||
std::string JSONServerConfigWithNoAdminPasswordAndLocalAdminFalse = fmt::format(
|
std::string const JSONServerConfigWithNoAdminPasswordAndLocalAdminFalse = fmt::format(
|
||||||
R"JSON({{
|
R"JSON({{
|
||||||
"server": {{
|
"server": {{
|
||||||
"ip": "0.0.0.0",
|
"ip": "0.0.0.0",
|
||||||
@@ -648,7 +646,7 @@ struct WebServerPrometheusTest : util::prometheus::WithPrometheus, WebServerTest
|
|||||||
TEST_F(WebServerPrometheusTest, rejectedWithoutAdminPassword)
|
TEST_F(WebServerPrometheusTest, rejectedWithoutAdminPassword)
|
||||||
{
|
{
|
||||||
auto e = std::make_shared<EchoExecutor>();
|
auto e = std::make_shared<EchoExecutor>();
|
||||||
uint32_t webServerPort = tests::util::generateFreePort();
|
uint32_t const webServerPort = tests::util::generateFreePort();
|
||||||
Config const serverConfig{parse(JSONServerConfigWithAdminPassword(webServerPort))};
|
Config const serverConfig{parse(JSONServerConfigWithAdminPassword(webServerPort))};
|
||||||
auto server = makeServerSync(serverConfig, ctx, std::nullopt, dosGuard, e);
|
auto server = makeServerSync(serverConfig, ctx, std::nullopt, dosGuard, e);
|
||||||
auto const res = HttpSyncClient::syncGet("localhost", std::to_string(webServerPort), "", "/metrics");
|
auto const res = HttpSyncClient::syncGet("localhost", std::to_string(webServerPort), "", "/metrics");
|
||||||
@@ -658,7 +656,7 @@ TEST_F(WebServerPrometheusTest, rejectedWithoutAdminPassword)
|
|||||||
TEST_F(WebServerPrometheusTest, rejectedIfPrometheusIsDisabled)
|
TEST_F(WebServerPrometheusTest, rejectedIfPrometheusIsDisabled)
|
||||||
{
|
{
|
||||||
uint32_t webServerPort = tests::util::generateFreePort();
|
uint32_t webServerPort = tests::util::generateFreePort();
|
||||||
std::string JSONServerConfigWithDisabledPrometheus = fmt::format(
|
std::string const JSONServerConfigWithDisabledPrometheus = fmt::format(
|
||||||
R"JSON({{
|
R"JSON({{
|
||||||
"server":{{
|
"server":{{
|
||||||
"ip": "0.0.0.0",
|
"ip": "0.0.0.0",
|
||||||
@@ -689,7 +687,7 @@ TEST_F(WebServerPrometheusTest, rejectedIfPrometheusIsDisabled)
|
|||||||
|
|
||||||
TEST_F(WebServerPrometheusTest, validResponse)
|
TEST_F(WebServerPrometheusTest, validResponse)
|
||||||
{
|
{
|
||||||
uint32_t webServerPort = tests::util::generateFreePort();
|
uint32_t const webServerPort = tests::util::generateFreePort();
|
||||||
auto& testCounter = PrometheusService::counterInt("test_counter", util::prometheus::Labels());
|
auto& testCounter = PrometheusService::counterInt("test_counter", util::prometheus::Labels());
|
||||||
++testCounter;
|
++testCounter;
|
||||||
auto e = std::make_shared<EchoExecutor>();
|
auto e = std::make_shared<EchoExecutor>();
|
||||||
|
|||||||
Reference in New Issue
Block a user