summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authormread <qt-info@nokia.com>2009-08-18 15:20:15 (GMT)
committermread <qt-info@nokia.com>2009-08-18 15:20:15 (GMT)
commit3803c3984aa5d3993066f3a0cc3218b44ab4eb6c (patch)
tree0a2344b6029440ad25cb14484668bae3a0e31b18 /tests
parent3ba8f80b42297ecc7832a5cdbdb0d044b4ca4cb6 (diff)
downloadQt-3803c3984aa5d3993066f3a0cc3218b44ab4eb6c.zip
Qt-3803c3984aa5d3993066f3a0cc3218b44ab4eb6c.tar.gz
Qt-3803c3984aa5d3993066f3a0cc3218b44ab4eb6c.tar.bz2
make the BigAlloc() test keep allocating if it's not done enough already
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/symbian/qmainexceptions/tst_qmainexceptions.cpp14
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);
}