fix: Fix GCC 15 discovered bugs (#2425)

This commit is contained in:
Ayaz Salikhov
2025-08-12 15:57:14 +01:00
committed by GitHub
parent 36bfcc7543
commit 7e42507b9a
4 changed files with 51 additions and 18 deletions

View File

@@ -45,7 +45,12 @@ TEST_F(AmendmentBlockHandlerTest, CallTonotifyAmendmentBlockedSetsStateAndRepeat
handler.notifyAmendmentBlocked();
EXPECT_TRUE(state.isAmendmentBlocked);
// Code runs significantly slower when assertions are enabled
#ifdef _GLIBCXX_ASSERTIONS
runContextFor(std::chrono::milliseconds{10});
#else
runContextFor(std::chrono::milliseconds{1});
#endif
}
struct DefaultAmendmentBlockActionTest : LoggerFixture {};

View File

@@ -17,6 +17,7 @@
*/
//==============================================================================
#include "data/Types.hpp"
#include "rpc/Errors.hpp"
#include "rpc/common/impl/ForwardingProxy.hpp"
#include "util/HandlerBaseTestFixture.hpp"
@@ -282,10 +283,17 @@ TEST_P(ShouldForwardParameterTest, Test)
EXPECT_CALL(*rawHandlerProviderPtr, isClioOnly(method)).Times(testBundle.called);
runSpawn([&](auto yield) {
auto const range = backend_->fetchLedgerRange();
auto const ctx = web::Context(
yield, method, apiVersion, params.as_object(), nullptr, tagFactory_, *range, kCLIENT_IP, testBundle.isAdmin
);
auto const ctx = web::Context{
yield,
method,
apiVersion,
params.as_object(),
nullptr,
tagFactory_,
data::LedgerRange{},
kCLIENT_IP,
testBundle.isAdmin,
};
auto const res = proxy_.shouldForward(ctx);
ASSERT_EQ(res, testBundle.expected);
@@ -311,9 +319,17 @@ TEST_F(RPCForwardingProxyTest, ForwardCallsBalancerWithCorrectParams)
EXPECT_CALL(counters_, rpcForwarded(method));
runSpawn([&](auto yield) {
auto const range = backend_->fetchLedgerRange();
auto const ctx =
web::Context(yield, method, apiVersion, params.as_object(), nullptr, tagFactory_, *range, kCLIENT_IP, true);
auto const ctx = web::Context{
yield,
method,
apiVersion,
params.as_object(),
nullptr,
tagFactory_,
data::LedgerRange{},
kCLIENT_IP,
true,
};
auto const res = proxy_.forward(ctx);
@@ -340,9 +356,17 @@ TEST_F(RPCForwardingProxyTest, ForwardingFailYieldsErrorStatus)
EXPECT_CALL(counters_, rpcFailedToForward(method));
runSpawn([&](auto yield) {
auto const range = backend_->fetchLedgerRange();
auto const ctx =
web::Context(yield, method, apiVersion, params.as_object(), nullptr, tagFactory_, *range, kCLIENT_IP, true);
auto const ctx = web::Context{
yield,
method,
apiVersion,
params.as_object(),
nullptr,
tagFactory_,
data::LedgerRange{},
kCLIENT_IP,
true,
};
auto const res = proxy_.forward(ctx);