Skip to content

Commit 357f02b

Browse files
committed
Create a local class inherited from BasicTestingSetup with a localized args manager
and put it into the getarg_tests namespace
1 parent 88d8b4e commit 357f02b

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

src/test/getarg_tests.cpp

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,18 @@
1313
#include <boost/algorithm/string.hpp>
1414
#include <boost/test/unit_test.hpp>
1515

16-
BOOST_FIXTURE_TEST_SUITE(getarg_tests, BasicTestingSetup)
16+
namespace getarg_tests{
17+
class LocalTestingSetup : BasicTestingSetup {
18+
protected:
19+
void SetupArgs(const std::vector<std::pair<std::string, unsigned int>>& args);
20+
void ResetArgs(const std::string& strArg);
21+
ArgsManager m_args;
22+
};
23+
}
24+
25+
BOOST_FIXTURE_TEST_SUITE(getarg_tests, LocalTestingSetup)
1726

18-
static void ResetArgs(const std::string& strArg)
27+
void LocalTestingSetup :: ResetArgs(const std::string& strArg)
1928
{
2029
std::vector<std::string> vecArg;
2130
if (strArg.size())
@@ -33,7 +42,7 @@ static void ResetArgs(const std::string& strArg)
3342
BOOST_CHECK(gArgs.ParseParameters(vecChar.size(), vecChar.data(), error));
3443
}
3544

36-
static void SetupArgs(const std::vector<std::pair<std::string, unsigned int>>& args)
45+
void LocalTestingSetup :: SetupArgs(const std::vector<std::pair<std::string, unsigned int>>& args)
3746
{
3847
gArgs.ClearArgs();
3948
for (const auto& arg : args) {

0 commit comments

Comments
 (0)