mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 14:38:29 +01:00
Merge #17473: refactor: Settings code cleanups
e9fd366044refactor: Remove null setting check in GetSetting() (Russell Yanofsky)cba2710220scripted-diff: Remove unused ArgsManager type flags in tests (Russell Yanofsky)425bb30725refactor: Add util_CheckValue test (Russell Yanofsky)0fa54358b0refactor: Add ArgsManager::GetSettingsList method (Russell Yanofsky)3e185522acrefactor: Get rid of ArgsManagerHelper class (Russell Yanofsky)dc0f148074refactor: Replace FlagsOfKnownArg with GetArgFlags (Russell Yanofsky)57e8b7a727refactor: Clean up includeconf comments (Russell Yanofsky)3f7dc9b808refactor: Clean up long lines in settings code (Russell Yanofsky) Pull request description: This PR doesn't change behavior. It just implements some suggestions from #15934 and #16545 and few other small cleanups. ACKs for top commit: jnewbery: Code review ACKe9fd366044MarcoFalke: ACKe9fd366044🚟 Tree-SHA512: 6e100d92c72f72bc39567187ab97a3547b3c06e5fcf1a1b74023358b8bca552124ca6a53c0ab53179b7f1329c03d9a73faaef6d73d2cd1a2321568a0286525e2
This commit is contained in:
@@ -46,6 +46,19 @@ BOOST_AUTO_TEST_CASE(Simple)
|
||||
CheckValues(settings2, R"("val2")", R"(["val2","val3"])");
|
||||
}
|
||||
|
||||
// Confirm that a high priority setting overrides a lower priority setting even
|
||||
// if the high priority setting is null. This behavior is useful for a high
|
||||
// priority setting source to be able to effectively reset any setting back to
|
||||
// its default value.
|
||||
BOOST_AUTO_TEST_CASE(NullOverride)
|
||||
{
|
||||
util::Settings settings;
|
||||
settings.command_line_options["name"].push_back("value");
|
||||
BOOST_CHECK_EQUAL(R"("value")", GetSetting(settings, "section", "name", false, false).write().c_str());
|
||||
settings.forced_settings["name"] = {};
|
||||
BOOST_CHECK_EQUAL(R"(null)", GetSetting(settings, "section", "name", false, false).write().c_str());
|
||||
}
|
||||
|
||||
// Test different ways settings can be merged, and verify results. This test can
|
||||
// be used to confirm that updates to settings code don't change behavior
|
||||
// unintentionally.
|
||||
|
||||
Reference in New Issue
Block a user