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:
1 parent
88d8b4e182
commit
357f02bf29
1 file changed
+12
-3
@@ -13,9 +13,18 @@
|
|||||||
#include <boost/algorithm/string.hpp>
|
#include <boost/algorithm/string.hpp>
|
||||||
#include <boost/test/unit_test.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;
|
std::vector<std::string> vecArg;
|
||||||
if (strArg.size())
|
if (strArg.size())
|
||||||
@@ -33,7 +42,7 @@ static void ResetArgs(const std::string& strArg)
|
|||||||
BOOST_CHECK(gArgs.ParseParameters(vecChar.size(), vecChar.data(), error));
|
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();
|
gArgs.ClearArgs();
|
||||||
for (const auto& arg : args) {
|
for (const auto& arg : args) {
|
||||||
|
|||||||
Reference in new issue
Block a user