diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-04-07 08:57:12 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-04-07 08:57:12 (GMT) |
commit | a113de78774cebb53d0571b9e567ddee10acee78 (patch) | |
tree | 5a52362a3db8d94b9f65a0af0a2511e28adffc2c /tests | |
parent | 7327d31b4e20bd4b3e3bad95c2fba3eb7a548dbb (diff) | |
parent | 71df6edab122730c38ac238e168a4cc35b6f4857 (diff) | |
download | Qt-a113de78774cebb53d0571b9e567ddee10acee78.zip Qt-a113de78774cebb53d0571b9e567ddee10acee78.tar.gz Qt-a113de78774cebb53d0571b9e567ddee10acee78.tar.bz2 |
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/qt-s60-public into 4.6-integration
* '4.6' of scm.dev.nokia.troll.no:qt/qt-s60-public:
QTBUG-4887 and other exception safety fixes
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/exceptionsafety_objects/tst_exceptionsafety_objects.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/auto/exceptionsafety_objects/tst_exceptionsafety_objects.cpp b/tests/auto/exceptionsafety_objects/tst_exceptionsafety_objects.cpp index 4433c7a..91d1a44 100644 --- a/tests/auto/exceptionsafety_objects/tst_exceptionsafety_objects.cpp +++ b/tests/auto/exceptionsafety_objects/tst_exceptionsafety_objects.cpp @@ -43,6 +43,7 @@ #include <QtTest/QtTest> #include <stddef.h> +#include <exception> QT_USE_NAMESPACE @@ -285,8 +286,26 @@ void tst_ExceptionSafetyObjects::safeMessageHandler(QtMsgType type, const char * allocFailer.reactivateAt(currentIndex); } +typedef void (*PVF)(); +PVF defaultTerminate; +void debugTerminate() +{ + // you can detect uncaught exceptions with a breakpoint in here + (*defaultTerminate)(); +} + +PVF defaultUnexpected; +void debugUnexpected() +{ + // you can detect unexpected exceptions with a breakpoint in here + (*defaultUnexpected)(); +} + void tst_ExceptionSafetyObjects::initTestCase() { + // set handlers for bad exception cases, you might want to step in and breakpoint the default handlers too + defaultTerminate = std::set_terminate(&debugTerminate); + defaultUnexpected = std::set_unexpected(&debugUnexpected); testMessageHandler = qInstallMsgHandler(safeMessageHandler); QVERIFY(AllocFailer::initialize()); |