Skip to content

Commit 8c3ff7d

Browse files
committed
test: Suggested cleanups for rpc_namedparams test
No changes in behavior, just implements review suggestions from bitcoin/bitcoin#19762 (comment) bitcoin/bitcoin#19762 (comment) bitcoin/bitcoin#26628 (comment)
1 parent d1ca563 commit 8c3ff7d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/test/rpc_tests.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ BOOST_FIXTURE_TEST_SUITE(rpc_tests, RPCTestingSetup)
8484

8585
BOOST_AUTO_TEST_CASE(rpc_namedparams)
8686
{
87-
const std::vector<std::string> arg_names{{"arg1", "arg2", "arg3", "arg4", "arg5"}};
87+
const std::vector<std::string> arg_names{"arg1", "arg2", "arg3", "arg4", "arg5"};
8888

8989
// Make sure named arguments are transformed into positional arguments in correct places separated by nulls
9090
BOOST_CHECK_EQUAL(TransformParams(JSON(R"({"arg2": 2, "arg4": 4})"), arg_names).write(), "[null,2,null,4]");
@@ -104,7 +104,7 @@ BOOST_AUTO_TEST_CASE(rpc_namedparams)
104104
BOOST_CHECK_EXCEPTION(TransformParams(JSON(R"({"args": [1,2,3], "arg4": 4, "arg2": 2})"), arg_names), UniValue,
105105
HasJSON(R"({"code":-8,"message":"Parameter arg2 specified twice both as positional and named argument"})"));
106106

107-
// Make sure extra positional arguments can be passed through to the method implemenation, as long as they don't overlap with named arguments.
107+
// Make sure extra positional arguments can be passed through to the method implementation, as long as they don't overlap with named arguments.
108108
BOOST_CHECK_EQUAL(TransformParams(JSON(R"({"args": [1,2,3,4,5,6,7,8,9,10]})"), arg_names).write(), "[1,2,3,4,5,6,7,8,9,10]");
109109
BOOST_CHECK_EQUAL(TransformParams(JSON(R"([1,2,3,4,5,6,7,8,9,10])"), arg_names).write(), "[1,2,3,4,5,6,7,8,9,10]");
110110
}

0 commit comments

Comments
 (0)