Skip to content

Commit

Permalink
Merge bitcoin#11997: [tests] util_tests.cpp: actually check ignored args
Browse files Browse the repository at this point in the history
c99a3c3 [tests] util_tests.cpp: actually check ignored args (Anthony Towns)

Pull request description:

  An array with 7 elements was setup for checking argument parsing, but
  was passed to ParseParamaeters with argc=5, meaning the interpretation
  of the last two arguments was never actually checked.

Tree-SHA512: 7b81fde49742e524f1bb67e2ec084f5909ae36125f237f0210df4587c62e5a5a8f277f13543f0a85ad145c4bb80d62339a7d50d7ed41659df318c8198ea7f428
  • Loading branch information
MarcoFalke authored and PastaPastaPasta committed Mar 23, 2020
1 parent da77fb8 commit 78727fa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/test/util_tests.cpp
Expand Up @@ -121,7 +121,7 @@ BOOST_AUTO_TEST_CASE(util_ParseParameters)
testArgs.ParseParameters(1, (char**)argv_test);
BOOST_CHECK(testArgs.GetMapArgs().empty() && testArgs.GetMapMultiArgs().empty());

testArgs.ParseParameters(5, (char**)argv_test);
testArgs.ParseParameters(7, (char**)argv_test);
// expectation: -ignored is ignored (program name argument),
// -a, -b and -ccc end up in map, -d ignored because it is after
// a non-option argument (non-GNU option parsing)
Expand Down

0 comments on commit 78727fa

Please sign in to comment.