diff options
author | glowang <wanggloria21@gmail.com> | 2020-05-11 21:50:54 -0700 |
---|---|---|
committer | glowang <wanggloria21@gmail.com> | 2020-05-28 06:21:43 -0700 |
commit | 357f02bf2942f2944a04a1ceaa687f89d5da7d28 (patch) | |
tree | ec2321001bab89af8e62697f2bdfbe88c91e332e | |
parent | 88d8b4e182bfc75e8496f7046af7aab93307b9d0 (diff) |
Create a local class inherited from BasicTestingSetup with a localized args manager
and put it into the getarg_tests namespace
-rw-r--r-- | src/test/getarg_tests.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/test/getarg_tests.cpp b/src/test/getarg_tests.cpp index 512e48f8e5..e902bf9082 100644 --- a/src/test/getarg_tests.cpp +++ b/src/test/getarg_tests.cpp @@ -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; + }; +} + +BOOST_FIXTURE_TEST_SUITE(getarg_tests, LocalTestingSetup) -static void ResetArgs(const std::string& strArg) +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) { |