Changeset View
Changeset View
Standalone View
Standalone View
src/test/settings_tests.cpp
// Copyright (c) 2011-2019 The Bitcoin Core developers | // Copyright (c) 2011-2019 The Bitcoin Core developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#include <util/settings.h> | #include <util/settings.h> | ||||
#include <test/util/setup_common.h> | #include <test/util/setup_common.h> | ||||
#include <test/util/str.h> | #include <test/util/str.h> | ||||
#include <util/strencodings.h> | #include <util/strencodings.h> | ||||
#include <util/string.h> | |||||
#include <util/system.h> | #include <util/system.h> | ||||
#include <univalue.h> | #include <univalue.h> | ||||
#include <boost/test/unit_test.hpp> | #include <boost/test/unit_test.hpp> | ||||
#include <vector> | #include <vector> | ||||
▲ Show 20 Lines • Show All 189 Lines • ▼ Show 20 Lines | ForEachMergeSetup([&](const ActionList &arg_actions, | ||||
const std::string &name = | const std::string &name = | ||||
ignore_default_section_config ? "wallet" : "server"; | ignore_default_section_config ? "wallet" : "server"; | ||||
auto push_values = [&](Action action, const char *value_prefix, | auto push_values = [&](Action action, const char *value_prefix, | ||||
const std::string &name_prefix, | const std::string &name_prefix, | ||||
std::vector<util::SettingsValue> &dest) { | std::vector<util::SettingsValue> &dest) { | ||||
if (action == SET || action == SECTION_SET) { | if (action == SET || action == SECTION_SET) { | ||||
for (int i = 0; i < 2; ++i) { | for (int i = 0; i < 2; ++i) { | ||||
dest.push_back(value_prefix + | dest.push_back(value_prefix + ToString(++value_suffix)); | ||||
std::to_string(++value_suffix)); | |||||
desc += | desc += | ||||
" " + name_prefix + name + "=" + dest.back().get_str(); | " " + name_prefix + name + "=" + dest.back().get_str(); | ||||
} | } | ||||
} else if (action == NEGATE || action == SECTION_NEGATE) { | } else if (action == NEGATE || action == SECTION_NEGATE) { | ||||
dest.push_back(false); | dest.push_back(false); | ||||
desc += " " + name_prefix + "no" + name; | desc += " " + name_prefix + "no" + name; | ||||
} | } | ||||
}; | }; | ||||
▲ Show 20 Lines • Show All 71 Lines • Show Last 20 Lines |