diff options
author | mread <qt-info@nokia.com> | 2009-08-18 15:20:15 (GMT) |
---|---|---|
committer | mread <qt-info@nokia.com> | 2009-08-18 15:20:15 (GMT) |
commit | 3803c3984aa5d3993066f3a0cc3218b44ab4eb6c (patch) | |
tree | 0a2344b6029440ad25cb14484668bae3a0e31b18 | |
parent | 3ba8f80b42297ecc7832a5cdbdb0d044b4ca4cb6 (diff) | |
download | Qt-3803c3984aa5d3993066f3a0cc3218b44ab4eb6c.zip Qt-3803c3984aa5d3993066f3a0cc3218b44ab4eb6c.tar.gz Qt-3803c3984aa5d3993066f3a0cc3218b44ab4eb6c.tar.bz2 |
make the BigAlloc() test keep allocating if it's not done enough already
-rw-r--r-- | tests/auto/symbian/qmainexceptions/tst_qmainexceptions.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/tests/auto/symbian/qmainexceptions/tst_qmainexceptions.cpp b/tests/auto/symbian/qmainexceptions/tst_qmainexceptions.cpp index b3d05ea..05e3054 100644 --- a/tests/auto/symbian/qmainexceptions/tst_qmainexceptions.cpp +++ b/tests/auto/symbian/qmainexceptions/tst_qmainexceptions.cpp @@ -186,8 +186,14 @@ void tst_qmainexceptions::testTranslateBadAlloc() void BigAlloc() { - int *x = new int[100000000]; - delete [] x; + // allocate too much memory - it's expected that 100M ints is too much, but keep doubling if not. + int *x = 0; + int n = 100000000; + do { + x = new int[n]; + delete [] x; + n = n * 2; + } while (x); } void TranslateBigAllocL() @@ -216,7 +222,7 @@ void tst_qmainexceptions::TestStdRoundTrip(const std::exception& thrown, const s { bool ok = false; try { - QT_TRAP_THROWING(qt_exception2SymbianLeaveL(thrown)); + QT_TRAP_THROWING(qt_symbian_exception2LeaveL(thrown)); } catch (const std::exception& ex) { const std::type_info& exType = typeid(ex); const std::type_info& caughtType = typeid(caught); @@ -243,7 +249,7 @@ void tst_qmainexceptions::testRoundTrip() void tst_qmainexceptions::testTrap() { // testing qt_exception2SymbianLeaveL - TRAPD(err, qt_exception2SymbianLeaveL(std::bad_alloc())); + TRAPD(err, qt_symbian_exception2LeaveL(std::bad_alloc())); QCOMPARE(err, KErrNoMemory); } |