summaryrefslogtreecommitdiffstats
path: root/tests/auto/testlib/selftests/verifyexceptionthrown/tst_verifyexceptionthrown.cpp
diff options
context:
space:
mode:
authorTarja Sundqvist <tarja.sundqvist@qt.io>2022-11-11 09:29:17 +0200
committerTarja Sundqvist <tarja.sundqvist@qt.io>2022-11-11 09:29:17 +0200
commit4ee4fc18b4067b90efa46ca9baba74f53b54d9ec (patch)
treecc68622c9b85992d99a8373ab55471ee821a4ebf /tests/auto/testlib/selftests/verifyexceptionthrown/tst_verifyexceptionthrown.cpp
parentab28ff2207e8f33754c79793089dbf943d67736d (diff)
parentebb49c66aaf22ed55d62ff7bc3690fce00b7d8ba (diff)
Merge remote-tracking branch 'origin/tqtc/lts-5.15.8' into tqtc/lts-5.15-opensourcev5.15.8-lts-lgpl
Diffstat (limited to 'tests/auto/testlib/selftests/verifyexceptionthrown/tst_verifyexceptionthrown.cpp')
-rw-r--r--tests/auto/testlib/selftests/verifyexceptionthrown/tst_verifyexceptionthrown.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/auto/testlib/selftests/verifyexceptionthrown/tst_verifyexceptionthrown.cpp b/tests/auto/testlib/selftests/verifyexceptionthrown/tst_verifyexceptionthrown.cpp
index 9fc490417c..fc12738604 100644
--- a/tests/auto/testlib/selftests/verifyexceptionthrown/tst_verifyexceptionthrown.cpp
+++ b/tests/auto/testlib/selftests/verifyexceptionthrown/tst_verifyexceptionthrown.cpp
@@ -112,12 +112,16 @@ void tst_VerifyExceptionThrown::testCorrectMyExceptions() const
void tst_VerifyExceptionThrown::testFailInt() const
{
- QVERIFY_EXCEPTION_THROWN(throw int(5), double);
+ try {
+ QVERIFY_EXCEPTION_THROWN(throw int(5), double);
+ } catch (int) {}
}
void tst_VerifyExceptionThrown::testFailStdString() const
{
- QVERIFY_EXCEPTION_THROWN(throw std::string("some string"), char*);
+ try {
+ QVERIFY_EXCEPTION_THROWN(throw std::string("some string"), char*);
+ } catch (const std::string &) {}
}
void tst_VerifyExceptionThrown::testFailStdRuntimeError() const