From 1edf153a6bc28e127531e852a0856025ca5d91b0 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Tue, 23 Nov 2021 08:52:22 +0100 Subject: Long live QVERIFY_THROWS_EXCEPTION! Use variable args macros to swallow any extra commas in the expression. To use this, the type of the exception has to be first. Use Eddy's suggestion for a new name to avoid breaking the old macro. [ChangeLog][QtTest] Added QVERIFY_THROWS_EXCEPTION, replacing QVERIFY_EXCEPTION_THROWN, which has therefore been deprecated. Change-Id: I16825c35bae0631c5fad5a9a3ace4d6edc067f83 Reviewed-by: Qt CI Bot Reviewed-by: Edward Welbourne --- tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp') diff --git a/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp b/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp index bd84d0bb3c..d526314d41 100644 --- a/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp +++ b/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp @@ -2688,7 +2688,7 @@ void tst_QSharedPointer::constructorThrow() int childDestructorCounter = ThrowData::childDestructorCounter; QSharedPointer ptr; - QVERIFY_EXCEPTION_THROWN(ptr = QSharedPointer::create(), QString); + QVERIFY_THROWS_EXCEPTION(QString, ptr = QSharedPointer::create()); QVERIFY(ptr.isNull()); QCOMPARE(ThrowData::childGenerationCounter, childGeneration + 1); // destructor should never be called, if a constructor throws -- cgit v1.2.3