126 | @@ -127,13 +127,26 @@ void RPCNestedTests::rpcNestedTests()
127 | RPCConsole::RPCExecuteCommandLine(m_node, result, "rpcNestedTest( abc , cba )");
128 | QVERIFY(result == "[\"abc\",\"cba\"]");
129 |
130 | +#if (QT_VERSION >= QT_VERSION_CHECK(6, 3, 0))
131 | + QVERIFY_THROWS_EXCEPTION(std::runtime_error, RPCConsole::RPCExecuteCommandLine(m_node, result, "getblockchaininfo() .\n")); //invalid syntax
2b5fd8fd24026ecf2fac7af6657e2363bfe3706c
An alternative to reduce duplicate code and the diff is to define QVERIFY_EXCEPTION_THROWN, something like?
// handle deprecated macro, can be removed once minimum Qt is at least 6.3.0
#if (QT_VERSION >= QT_VERSION_CHECK(6, 3, 0))
#define QVERIFY_EXCEPTION_THROWN(a, b) QVERIFY_THROWS_EXCEPTION(b, a)
#endif
Thanks! Reworked per your feedback.