From 54fbcc0e1255ac93bc035eb93db212c9fbaed7c2 Mon Sep 17 00:00:00 2001 From: Oleh Nikolaiev Date: Wed, 5 Feb 2025 18:41:31 +0000 Subject: [PATCH] #1870 improve tests --- test/unittests/libweb3jsonrpc/jsonrpc.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/unittests/libweb3jsonrpc/jsonrpc.cpp b/test/unittests/libweb3jsonrpc/jsonrpc.cpp index 8f3418557..e3b197f0e 100644 --- a/test/unittests/libweb3jsonrpc/jsonrpc.cpp +++ b/test/unittests/libweb3jsonrpc/jsonrpc.cpp @@ -396,20 +396,22 @@ struct JsonRpcFixture : public TestOutputHelperFixture { sleep( 1 ); - auto httpClient = new jsonrpc::HttpClient( + httpClient = new jsonrpc::HttpClient( "http://" + chainParams.nodeInfo.ip + ":" + std::to_string( serverOpts.netOpts_.bindOptsStandard_.nBasePortHTTP4_ ) ); httpClient->SetTimeout( 1000000000 ); rpcClient = unique_ptr< WebThreeStubClient >( new WebThreeStubClient( *httpClient ) ); - BOOST_TEST_MESSAGE( "Constructed JsonRpcFixture" ); } ~JsonRpcFixture() { if ( skale_server_connector ) skale_server_connector->StopListening(); + + if ( httpClient ) + delete httpClient; BOOST_TEST_MESSAGE( "Destructed JsonRpcFixture" ); } @@ -447,6 +449,7 @@ struct JsonRpcFixture : public TestOutputHelperFixture { unique_ptr< WebThreeStubClient > rpcClient; std::string adminSession; SkaleServerOverride* skale_server_connector; + jsonrpc::HttpClient* httpClient; time_t powPatchActivationTimestamp; time_t push0PatchActivationTimestamp; };