mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-10 11:57:28 -03:00
qt6, test: Handle deprecated QVERIFY_EXCEPTION_THROWN
This change ensures compatibility across all supported Qt versions. Co-Authored-By: João Barbosa <joao.paulo.barbosa@gmail.com>
This commit is contained in:
parent
cb750b4b40
commit
5625840c11
1 changed files with 5 additions and 0 deletions
|
@ -127,6 +127,11 @@ void RPCNestedTests::rpcNestedTests()
|
|||
RPCConsole::RPCExecuteCommandLine(m_node, result, "rpcNestedTest( abc , cba )");
|
||||
QVERIFY(result == "[\"abc\",\"cba\"]");
|
||||
|
||||
// Handle deprecated macro, can be removed once minimum Qt is at least 6.3.0.
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(6, 3, 0))
|
||||
#undef QVERIFY_EXCEPTION_THROWN
|
||||
#define QVERIFY_EXCEPTION_THROWN(expression, exceptiontype) QVERIFY_THROWS_EXCEPTION(exceptiontype, expression)
|
||||
#endif
|
||||
QVERIFY_EXCEPTION_THROWN(RPCConsole::RPCExecuteCommandLine(m_node, result, "getblockchaininfo() .\n"), std::runtime_error); //invalid syntax
|
||||
QVERIFY_EXCEPTION_THROWN(RPCConsole::RPCExecuteCommandLine(m_node, result, "getblockchaininfo() getblockchaininfo()"), std::runtime_error); //invalid syntax
|
||||
RPCConsole::RPCExecuteCommandLine(m_node, result, "getblockchaininfo("); //tolerate non closing brackets if we have no arguments
|
||||
|
|
Loading…
Reference in a new issue