Changeset View
Changeset View
Standalone View
Standalone View
src/test/getarg_tests.cpp
Show All 23 Lines | static void ResetArgs(const std::string &strArg) { | ||||
vecArg.insert(vecArg.begin(), "testbitcoin"); | vecArg.insert(vecArg.begin(), "testbitcoin"); | ||||
// Convert to char*: | // Convert to char*: | ||||
std::vector<const char *> vecChar; | std::vector<const char *> vecChar; | ||||
for (std::string &s : vecArg) { | for (std::string &s : vecArg) { | ||||
vecChar.push_back(s.c_str()); | vecChar.push_back(s.c_str()); | ||||
} | } | ||||
gArgs.ParseParameters(vecChar.size(), &vecChar[0]); | gArgs.ParseParameters(vecChar.size(), vecChar.data()); | ||||
} | } | ||||
BOOST_AUTO_TEST_CASE(boolarg) { | BOOST_AUTO_TEST_CASE(boolarg) { | ||||
ResetArgs("-foo"); | ResetArgs("-foo"); | ||||
BOOST_CHECK(gArgs.GetBoolArg("-foo", false)); | BOOST_CHECK(gArgs.GetBoolArg("-foo", false)); | ||||
BOOST_CHECK(gArgs.GetBoolArg("-foo", true)); | BOOST_CHECK(gArgs.GetBoolArg("-foo", true)); | ||||
BOOST_CHECK(!gArgs.GetBoolArg("-fo", false)); | BOOST_CHECK(!gArgs.GetBoolArg("-fo", false)); | ||||
▲ Show 20 Lines • Show All 121 Lines • Show Last 20 Lines |