mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-18 22:35:39 +01:00
Create a local class inherited from BasicTestingSetup with a localized args manager
and put it into the getarg_tests namespace
This commit is contained in:
@@ -13,9 +13,18 @@
|
||||
#include <boost/algorithm/string.hpp>
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
||||
BOOST_FIXTURE_TEST_SUITE(getarg_tests, BasicTestingSetup)
|
||||
namespace getarg_tests{
|
||||
class LocalTestingSetup : BasicTestingSetup {
|
||||
protected:
|
||||
void SetupArgs(const std::vector<std::pair<std::string, unsigned int>>& args);
|
||||
void ResetArgs(const std::string& strArg);
|
||||
ArgsManager m_args;
|
||||
};
|
||||
}
|
||||
|
||||
static void ResetArgs(const std::string& strArg)
|
||||
BOOST_FIXTURE_TEST_SUITE(getarg_tests, LocalTestingSetup)
|
||||
|
||||
void LocalTestingSetup :: ResetArgs(const std::string& strArg)
|
||||
{
|
||||
std::vector<std::string> vecArg;
|
||||
if (strArg.size())
|
||||
@@ -33,7 +42,7 @@ static void ResetArgs(const std::string& strArg)
|
||||
BOOST_CHECK(gArgs.ParseParameters(vecChar.size(), vecChar.data(), error));
|
||||
}
|
||||
|
||||
static void SetupArgs(const std::vector<std::pair<std::string, unsigned int>>& args)
|
||||
void LocalTestingSetup :: SetupArgs(const std::vector<std::pair<std::string, unsigned int>>& args)
|
||||
{
|
||||
gArgs.ClearArgs();
|
||||
for (const auto& arg : args) {
|
||||
|
||||
Reference in New Issue
Block a user