Skip to content

Commit 5625840

Browse files
hebastopromag
andcommitted
qt6, test: Handle deprecated QVERIFY_EXCEPTION_THROWN
This change ensures compatibility across all supported Qt versions. Co-Authored-By: João Barbosa <[email protected]>
1 parent cb750b4 commit 5625840

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/qt/test/rpcnestedtests.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,11 @@ void RPCNestedTests::rpcNestedTests()
127127
RPCConsole::RPCExecuteCommandLine(m_node, result, "rpcNestedTest( abc , cba )");
128128
QVERIFY(result == "[\"abc\",\"cba\"]");
129129

130+
// Handle deprecated macro, can be removed once minimum Qt is at least 6.3.0.
131+
#if (QT_VERSION >= QT_VERSION_CHECK(6, 3, 0))
132+
#undef QVERIFY_EXCEPTION_THROWN
133+
#define QVERIFY_EXCEPTION_THROWN(expression, exceptiontype) QVERIFY_THROWS_EXCEPTION(exceptiontype, expression)
134+
#endif
130135
QVERIFY_EXCEPTION_THROWN(RPCConsole::RPCExecuteCommandLine(m_node, result, "getblockchaininfo() .\n"), std::runtime_error); //invalid syntax
131136
QVERIFY_EXCEPTION_THROWN(RPCConsole::RPCExecuteCommandLine(m_node, result, "getblockchaininfo() getblockchaininfo()"), std::runtime_error); //invalid syntax
132137
RPCConsole::RPCExecuteCommandLine(m_node, result, "getblockchaininfo("); //tolerate non closing brackets if we have no arguments

0 commit comments

Comments
 (0)