summaryrefslogtreecommitdiffstats
path: root/tests/auto/qpixmapcache
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@trolltech.com>2009-08-11 17:56:43 +0200
committerJoerg Bornemann <joerg.bornemann@trolltech.com>2009-08-11 18:03:18 +0200
commit204c771ab5c0ef62c76ead594bfeacc3627ab108 (patch)
treebd3c514f52090306bb30a88f77da2ec40274cd14 /tests/auto/qpixmapcache
parentee7d7a4f3016e8ca94bde5c2328676e31bf4eba2 (diff)
fix tst_QPixmapCache::clear for Windows CE
This test used too much memory for Windows CE <= 5. Reviewed-by: thartman
Diffstat (limited to 'tests/auto/qpixmapcache')
-rw-r--r--tests/auto/qpixmapcache/tst_qpixmapcache.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/tests/auto/qpixmapcache/tst_qpixmapcache.cpp b/tests/auto/qpixmapcache/tst_qpixmapcache.cpp
index e71bd5d04d..7866df86cf 100644
--- a/tests/auto/qpixmapcache/tst_qpixmapcache.cpp
+++ b/tests/auto/qpixmapcache/tst_qpixmapcache.cpp
@@ -392,14 +392,19 @@ void tst_QPixmapCache::clear()
QPixmap p1(10, 10);
p1.fill(Qt::red);
- for (int i = 0; i < 20000; ++i)
+#ifdef Q_OS_WINCE
+ const int numberOfKeys = 10000;
+#else
+ const int numberOfKeys = 20000;
+#endif
+ for (int i = 0; i < numberOfKeys; ++i)
QVERIFY(QPixmapCache::find("x" + QString::number(i)) == 0);
- for (int j = 0; j < 20000; ++j)
+ for (int j = 0; j < numberOfKeys; ++j)
QPixmapCache::insert(QString::number(j), p1);
int num = 0;
- for (int k = 0; k < 20000; ++k) {
+ for (int k = 0; k < numberOfKeys; ++k) {
if (QPixmapCache::find(QString::number(k), p1))
++num;
}
@@ -407,7 +412,7 @@ void tst_QPixmapCache::clear()
QPixmapCache::clear();
- for (int k = 0; k < 20000; ++k)
+ for (int k = 0; k < numberOfKeys; ++k)
QVERIFY(QPixmapCache::find(QString::number(k)) == 0);
//The int part of the API
@@ -415,12 +420,12 @@ void tst_QPixmapCache::clear()
p2.fill(Qt::red);
QList<QPixmapCache::Key> keys;
- for (int k = 0; k < 20000; ++k)
+ for (int k = 0; k < numberOfKeys; ++k)
keys.append(QPixmapCache::insert(p2));
QPixmapCache::clear();
- for (int k = 0; k < 20000; ++k) {
+ for (int k = 0; k < numberOfKeys; ++k) {
QVERIFY(QPixmapCache::find(keys.at(k), &p1) == 0);
QCOMPARE(getPrivate(keys[k])->isValid, false);
}