summaryrefslogtreecommitdiffstats
path: root/tests/auto/symbian
diff options
context:
space:
mode:
authorMurray Read <ext-murray.2.read@nokia.com>2012-01-26 12:33:39 +0000
committerQt by Nokia <qt-info@nokia.com>2012-01-26 17:42:16 +0100
commit8c5614dda55ed7b539e06a3846618df8255dd18c (patch)
tree78748a0e549aec70b6198210f40fe1ee3e7eb3c8 /tests/auto/symbian
parentdd36b63ccac0026ac0a22681052e88cff8258923 (diff)
Fix exception handling in Symbian event dispatcher
The Symbian event dispatcher handles exceptions from active objects as well as leaves. But if the active object throws while it has something pushed on the cleanup stack, the exception must be converted to a leave for the cleanup to happen and the cleanup stack balance to be maintained. Task-number: ou1cimx1#970701 Change-Id: I6c8eed61cb1666e36eb4858a2c72ad0d8c6b0c8f Reviewed-by: Shane Kearns <ext-shane.2.kearns@nokia.com>
Diffstat (limited to 'tests/auto/symbian')
-rw-r--r--tests/auto/symbian/qmainexceptions/tst_qmainexceptions.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/auto/symbian/qmainexceptions/tst_qmainexceptions.cpp b/tests/auto/symbian/qmainexceptions/tst_qmainexceptions.cpp
index af065aea3e..f29e12ac94 100644
--- a/tests/auto/symbian/qmainexceptions/tst_qmainexceptions.cpp
+++ b/tests/auto/symbian/qmainexceptions/tst_qmainexceptions.cpp
@@ -163,6 +163,7 @@ private slots:
void leave();
void testTranslateBadAlloc();
void testTranslateBigAlloc();
+ void testExceptionFromAO();
void testRoundTrip();
void testTrap();
void testPropagation();
@@ -327,6 +328,15 @@ void tst_qmainexceptions::testTranslateBigAlloc()
TestSchedulerCatchesError(&TranslateBigAllocL, KErrNoMemory);
}
+void tst_qmainexceptions::testExceptionFromAO()
+{
+ CTestActive *act = new(ELeave) CTestActive(&ThrowBadAlloc, true);
+ act->Test();
+ QCOMPARE(act->error, KErrNoMemory);
+ QVERIFY(act->cleanedUp);
+ delete act;
+}
+
void tst_qmainexceptions::TestSymbianRoundTrip(int leave, int trap)
{
// check that leave converted to exception, converted to error gives expected error code