summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Alanen <denravonska@gmail.com>2011-04-01 10:52:19 +0200
committerJoão Abecasis <joao.abecasis@nokia.com>2011-04-01 11:04:11 +0200
commit467fdd578e6787497f2b702dca0cf38afdc0e6de (patch)
tree73cb7fafdcfa06438c41a6387007209770b3a279
parentf285904ae2f376c39ee3538aa2362e9632534700 (diff)
Fix bug when catching exceptions in tests.
Resets currentTestObject if an exception is caught while executing a test suite. This is required or else subsequent test executions will trigger an assert. Task-number: QTBUG-3869 Merge-request: 1163 Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
-rw-r--r--src/testlib/qtestcase.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp
index 287d8e6c8f..9a0d08726f 100644
--- a/src/testlib/qtestcase.cpp
+++ b/src/testlib/qtestcase.cpp
@@ -1865,6 +1865,8 @@ int QTest::qExec(QObject *testObject, int argc, char **argv)
IOPMAssertionRelease(powerID);
}
#endif
+ currentTestObject = 0;
+
// Rethrow exception to make debugging easier.
throw;
return 1;