Skip to content

Commit fa690c8

Browse files
author
MarcoFalke
committed
test: [refactor] Pass TestOpts
1 parent bd5d168 commit fa690c8

13 files changed

+40
-41
lines changed

src/bench/logging.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ static void Logging(benchmark::Bench& bench, const std::vector<const char*>& ext
2020

2121
TestingSetup test_setup{
2222
ChainType::REGTEST,
23-
extra_args,
23+
{.extra_args = extra_args},
2424
};
2525

2626
bench.run([&] { log(); });

src/bench/mempool_stress.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ static void ComplexMemPool(benchmark::Bench& bench)
106106
static void MempoolCheck(benchmark::Bench& bench)
107107
{
108108
FastRandomContext det_rand{true};
109-
auto testing_setup = MakeNoLogFileContext<TestChain100Setup>(ChainType::REGTEST, {"-checkmempool=1"});
109+
auto testing_setup = MakeNoLogFileContext<TestChain100Setup>(ChainType::REGTEST, {.extra_args = {"-checkmempool=1"}});
110110
CTxMemPool& pool = *testing_setup.get()->m_node.mempool;
111111
LOCK2(cs_main, pool.cs);
112112
testing_setup->PopulateMempool(det_rand, 400, true);

src/test/checkqueue_tests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
struct NoLockLoggingTestingSetup : public TestingSetup {
2929
NoLockLoggingTestingSetup()
3030
#ifdef DEBUG_LOCKCONTENTION
31-
: TestingSetup{ChainType::MAIN, /*extra_args=*/{"-debugexclude=lock"}} {}
31+
: TestingSetup{ChainType::MAIN, {.extra_args = { "-debugexclude=lock" } }} {}
3232
#else
3333
: TestingSetup{ChainType::MAIN} {}
3434
#endif

src/test/fuzz/process_message.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ void initialize_process_message()
4242

4343
static const auto testing_setup = MakeNoLogFileContext<const TestingSetup>(
4444
/*chain_type=*/ChainType::REGTEST,
45-
/*extra_args=*/{"-txreconciliation"});
45+
{.extra_args = {"-txreconciliation"}});
4646
g_setup = testing_setup.get();
4747
for (int i = 0; i < 2 * COINBASE_MATURITY; i++) {
4848
MineBlock(g_setup->m_node, CScript() << OP_TRUE);

src/test/fuzz/process_messages.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ void initialize_process_messages()
3232
{
3333
static const auto testing_setup = MakeNoLogFileContext<const TestingSetup>(
3434
/*chain_type=*/ChainType::REGTEST,
35-
/*extra_args=*/{"-txreconciliation"});
35+
{.extra_args = {"-txreconciliation"}});
3636
g_setup = testing_setup.get();
3737
for (int i = 0; i < 2 * COINBASE_MATURITY; i++) {
3838
MineBlock(g_setup->m_node, CScript() << OP_TRUE);

src/test/fuzz/rpc.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ using util::ToString;
4141

4242
namespace {
4343
struct RPCFuzzTestingSetup : public TestingSetup {
44-
RPCFuzzTestingSetup(const ChainType chain_type, const std::vector<const char*>& extra_args) : TestingSetup{chain_type, extra_args}
44+
RPCFuzzTestingSetup(const ChainType chain_type, TestOpts opts) : TestingSetup{chain_type, opts}
4545
{
4646
}
4747

src/test/fuzz/utxo_total_supply.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ FUZZ_TARGET(utxo_total_supply)
2323
ChainTestingSetup test_setup{
2424
ChainType::REGTEST,
2525
{
26-
"-testactivationheight=bip34@2",
26+
.extra_args = {"-testactivationheight=bip34@2"},
2727
},
2828
};
2929
// Create chainstate

src/test/i2p_tests.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ class EnvTestingSetup : public BasicTestingSetup
2323
{
2424
public:
2525
explicit EnvTestingSetup(const ChainType chainType = ChainType::MAIN,
26-
const std::vector<const char*>& extra_args = {})
27-
: BasicTestingSetup{chainType, extra_args},
26+
TestOpts opts = {})
27+
: BasicTestingSetup{chainType, opts},
2828
m_prev_log_level{LogInstance().LogLevel()},
2929
m_create_sock_orig{CreateSock}
3030
{

src/test/net_peer_connection_tests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
struct LogIPsTestingSetup : public TestingSetup {
3333
LogIPsTestingSetup()
34-
: TestingSetup{ChainType::MAIN, /*extra_args=*/{"-logips"}} {}
34+
: TestingSetup{ChainType::MAIN, {.extra_args = {"-logips"}}} {}
3535
};
3636

3737
BOOST_FIXTURE_TEST_SUITE(net_peer_connection_tests, LogIPsTestingSetup)

src/test/txvalidationcache_tests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
struct Dersig100Setup : public TestChain100Setup {
1818
Dersig100Setup()
19-
: TestChain100Setup{ChainType::REGTEST, {"-testactivationheight=dersig@102"}} {}
19+
: TestChain100Setup{ChainType::REGTEST, {.extra_args = {"-testactivationheight=dersig@102"}}} {}
2020
};
2121

2222
bool CheckInputScripts(const CTransaction& tx, TxValidationState& state,

0 commit comments

Comments
 (0)