Changeset View
Changeset View
Standalone View
Standalone View
src/test/getarg_tests.cpp
Show All 30 Lines | static void ResetArgs(ArgsManager &am, const std::string &strArg) { | ||||
} | } | ||||
std::string error; | std::string error; | ||||
BOOST_CHECK(am.ParseParameters(vecChar.size(), vecChar.data(), error)); | BOOST_CHECK(am.ParseParameters(vecChar.size(), vecChar.data(), error)); | ||||
} | } | ||||
static void SetupArgs(ArgsManager &am, const std::vector<std::string> &args) { | static void SetupArgs(ArgsManager &am, const std::vector<std::string> &args) { | ||||
for (const std::string &arg : args) { | for (const std::string &arg : args) { | ||||
am.AddArg(arg, "", false, OptionsCategory::OPTIONS); | am.AddArg(arg, "", ArgsManager::ALLOW_ANY, false, | ||||
OptionsCategory::OPTIONS); | |||||
} | } | ||||
} | } | ||||
BOOST_AUTO_TEST_CASE(boolarg) { | BOOST_AUTO_TEST_CASE(boolarg) { | ||||
ArgsManager am; | ArgsManager am; | ||||
SetupArgs(am, {"-foo"}); | SetupArgs(am, {"-foo"}); | ||||
ResetArgs(am, "-foo"); | ResetArgs(am, "-foo"); | ||||
BOOST_CHECK(am.GetBoolArg("-foo", false)); | BOOST_CHECK(am.GetBoolArg("-foo", false)); | ||||
▲ Show 20 Lines • Show All 132 Lines • Show Last 20 Lines |