mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-15 12:51:00 +02:00
test: refactor: Give unit test functions access to test state
Add unit test subclasses as needed so unit test functions that need to access members like m_rng can reference it directly.
This commit is contained in:
parent
fab023e177
commit
3dc527f460
16 changed files with 145 additions and 81 deletions
|
|
@ -340,6 +340,7 @@ void SatisfactionToWitness(miniscript::MiniscriptContext ctx, CScriptWitness& wi
|
|||
witness.stack.push_back(*builder.GetSpendData().scripts.begin()->second.begin());
|
||||
}
|
||||
|
||||
struct MiniScriptTest : BasicTestingSetup {
|
||||
/** Run random satisfaction tests. */
|
||||
void TestSatisfy(const KeyConverter& converter, const std::string& testcase, const NodeRef& node) {
|
||||
auto script = node->ToScript(converter);
|
||||
|
|
@ -488,10 +489,11 @@ void Test(const std::string& ms, const std::string& hexscript, const std::string
|
|||
/*opslimit=*/-1, /*stacklimit=*/-1,
|
||||
/*max_wit_size=*/std::nullopt, /*max_tap_wit_size=*/std::nullopt, /*stack_exec=*/std::nullopt);
|
||||
}
|
||||
}; // struct MiniScriptTest
|
||||
|
||||
} // namespace
|
||||
|
||||
BOOST_FIXTURE_TEST_SUITE(miniscript_tests, BasicTestingSetup)
|
||||
BOOST_FIXTURE_TEST_SUITE(miniscript_tests, MiniScriptTest)
|
||||
|
||||
BOOST_AUTO_TEST_CASE(fixed_tests)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue