HomePhabricator

Add test for ArgsManager::GetChainName

Description

Add test for ArgsManager::GetChainName

Summary:

  • util_SettingsMerge test cleanup

Followup to #15869. Treat "-wallet" as the network-specific argument in test
instead of "-server", to make test output clearer and be more consistent with
bitcoind. Update embedded hash to match changed output from this.

  • Add unit test NextString, ForEachNoDup functions

Remove testcase generating code from util_SettingsMerge so it can be reused in
new tests.

The hash value expected in util_SettingsMerge changes as a result of this, but
only because the testcases are generated in a different order, not because any
cases are added or removed. It is possible to verify this with:

SETTINGS_MERGE_TEST_OUT=new.txt test/test_bitcoin --run_test=util_tests/util_SettingsMerge
git checkout HEAD~1
make test/test_bitcoin
SETTINGS_MERGE_TEST_OUT=old.txt test/test_bitcoin --run_test=util_tests/util_SettingsMerge
diff -u <(sort old.txt) <(sort new.txt)

The new output is a little more readable, with simpler testcases sorted first.

  • Add test for ArgsManager::GetChainName

There was some test coverage previously, but it was limited and didn't test
conflicting and negated arguments.

This is a backport of Core PR15988

Test Plan:

ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D5860

Details

Provenance
Russell Yanofsky <russ@yanofsky.org>Authored on Apr 24 2019, 09:57
deadalnixCommitted on Apr 28 2020, 13:34
deadalnixPushed on Apr 28 2020, 13:34
Reviewer
Restricted Project
Differential Revision
D5860: Add test for ArgsManager::GetChainName
Parents
rABC176b45570884: Fix -Wdeprecated-copy warning with GCC >= 9
Branches
Unknown
Tags
Unknown