mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-08 10:31:50 -05: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:
parent
88d8b4e182
commit
357f02bf29
1 changed files with 12 additions and 3 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Reference in a new issue