summaryrefslogtreecommitdiffstats
path: root/src/plugins/sqldrivers/mysql/qsql_mysql.cpp
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2024-01-10 10:49:44 +0100
committerMarc Mutz <marc.mutz@qt.io>2024-01-23 10:20:53 +0000
commitf0dcbb66e8c54d497d5d118a13a7a0b4fc1b3d94 (patch)
tree019a685f98a5ef55c7089417025c22ede58ed517 /src/plugins/sqldrivers/mysql/qsql_mysql.cpp
parent79e1389fb9ea4e43e61ab35e41ed275cb76eedbc (diff)
QTest: Extract Method qCaught() from THROWS_(NO_)EXCEPTION
We've already done a lot in 59600a514ba99ed62b46237d8f160dea84474190, but we can do more: Thanks to std::exception_ptr, we can drag the handling of unexpected exceptions completely to out-of-line code, leaving only the catch(...) as inline. As a nice side-effect, we no longer need the nested try blocks in QVERIFY_THROWS_EXCEPTION to work around GCC -Wexceptions or MSVC C2312 complaining about two handlers for the same exception type (which can happen when exceptiontype is std::exception itself). This may not handle __cxxabi::__forced_unwind correctly, but it doesn't need to: Tests should not need to call THROWS_EXECPTION on code that could emit a pthread cancellation; tests are controlled environments. Keep the old qCaught() function for BC. We don't promise BC in QtTestLib, but it doesn't cost much. Pick-to: 6.7 Change-Id: I1e1627c6341b09197a8a79669fde061c47e6ba47 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src/plugins/sqldrivers/mysql/qsql_mysql.cpp')
0 files changed, 0 insertions, 0 deletions