diff options
author | Murray Read <ext-murray.2.read@nokia.com> | 2012-01-26 12:33:39 (GMT) |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-01-26 16:42:16 (GMT) |
commit | 8c5614dda55ed7b539e06a3846618df8255dd18c (patch) | |
tree | 78748a0e549aec70b6198210f40fe1ee3e7eb3c8 /tests/auto | |
parent | dd36b63ccac0026ac0a22681052e88cff8258923 (diff) | |
download | Qt-8c5614dda55ed7b539e06a3846618df8255dd18c.zip Qt-8c5614dda55ed7b539e06a3846618df8255dd18c.tar.gz Qt-8c5614dda55ed7b539e06a3846618df8255dd18c.tar.bz2 |
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')
-rw-r--r-- | tests/auto/symbian/qmainexceptions/tst_qmainexceptions.cpp | 10 |
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 af065ae..f29e12a 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 |