summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2011-09-10 15:34:49 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2011-09-10 15:34:49 (GMT)
commit704dd92581783d91ccd234d58896d7078eed14a5 (patch)
tree29d20b77fb3760cd47e980acc74432624e841be4 /tests
parentc21ec3f5a4cce90218a70a1ef657cd38fb20027f (diff)
parentb318fc0800c3081af16a38614b95dd50a82b6bbb (diff)
downloadQt-704dd92581783d91ccd234d58896d7078eed14a5.zip
Qt-704dd92581783d91ccd234d58896d7078eed14a5.tar.gz
Qt-704dd92581783d91ccd234d58896d7078eed14a5.tar.bz2
Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-fire-staging into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/qt-fire-staging: Disable autotest broken by the change to QCache in 7ab0bed Generate glyphs in un-transformed coordinate system. Use QT_MAX_CACHED_GLYPH_SIZE in QFontEngineFT Reset trailingSpaces in relayout Prevent QPixmapCache potentially growing indefinitely. Allocate 16-byte aligned memory independent of platform for raster pool. Fix trailing spaces problem by not adding it to QScriptLine.length Fix RTL layout for fonts when non-printable character has an advance Fix regression in tst_qrawfont Make it compile on mac Fixed compiling error in qvfb. micro optimizations fix "comparison between signed and unsigned" warnings on windows, don't resolve the gdi32's symbols for each QRawFont instance fix typo in the docs QRawFont: add missed operator != optimize QGlyphRun's operator == a bit QGlyphRun: make operator != inlined QGlyphRun: don't detach if the decoration wasn't actually changed QPA event loop: Set a timeout != 0 if there are no timers.
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/collections/tst_collections.cpp4
-rw-r--r--tests/auto/qpixmapcache/tst_qpixmapcache.cpp25
2 files changed, 28 insertions, 1 deletions
diff --git a/tests/auto/collections/tst_collections.cpp b/tests/auto/collections/tst_collections.cpp
index 00cdec3..e13e1d9 100644
--- a/tests/auto/collections/tst_collections.cpp
+++ b/tests/auto/collections/tst_collections.cpp
@@ -2442,6 +2442,7 @@ void tst_Collections::cache()
QVERIFY(!cache.contains(2));
delete cache.take(10);
}
+#if 0
{
QCache<int, QString> cache(120);
int i;
@@ -2455,6 +2456,7 @@ void tst_Collections::cache()
QVERIFY(!cache.contains(3));
QVERIFY(cache.contains(2));
}
+#endif
{
QCache<int, int> cache(100);
cache.insert(2, new int(2));
@@ -3505,7 +3507,7 @@ void testVectorAlignment()
for (int i = 0; i < 200; ++i)
container.append(Aligned());
-
+
for (int i = 0; i < container.size(); ++i)
QVERIFY(container.at(i).checkAligned());
}
diff --git a/tests/auto/qpixmapcache/tst_qpixmapcache.cpp b/tests/auto/qpixmapcache/tst_qpixmapcache.cpp
index 9f7192d..b36cf98 100644
--- a/tests/auto/qpixmapcache/tst_qpixmapcache.cpp
+++ b/tests/auto/qpixmapcache/tst_qpixmapcache.cpp
@@ -72,6 +72,7 @@ private slots:
void clear();
void pixmapKey();
void noLeak();
+ void strictCacheLimit();
};
static QPixmapCache::KeyData* getPrivate(QPixmapCache::Key &key)
@@ -517,5 +518,29 @@ void tst_QPixmapCache::noLeak()
QCOMPARE(oldSize, newSize);
}
+
+void tst_QPixmapCache::strictCacheLimit()
+{
+ const int limit = 1024; // 1024 KB
+
+ QPixmapCache::clear();
+ QPixmapCache::setCacheLimit(limit);
+
+ // insert 200 64x64 pixmaps
+ // 3200 KB for 32-bit depths
+ // 1600 KB for 16-bit depths
+ // not counting the duplicate entries
+ for (int i = 0; i < 200; ++i) {
+ QPixmap pixmap(64, 64);
+ pixmap.fill(Qt::transparent);
+
+ QString id = QString::number(i);
+ QPixmapCache::insert(id + "-a", pixmap);
+ QPixmapCache::insert(id + "-b", pixmap);
+ }
+
+ QVERIFY(QPixmapCache::totalUsed() <= limit);
+}
+
QTEST_MAIN(tst_QPixmapCache)
#include "tst_qpixmapcache.moc"