summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-02-17 17:32:37 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-02-17 17:32:37 (GMT)
commit720d56486c3a3fd2d4d6517b8805ff96d3c6da60 (patch)
tree053c3b12347554bc22d502a554ca7c47a799c392 /tests
parent340b44156245a520e53119815670becd3eb7fb70 (diff)
parent9531f924478d78f0a679305cd2e5f1b4c4dd849e (diff)
downloadQt-720d56486c3a3fd2d4d6517b8805ff96d3c6da60.zip
Qt-720d56486c3a3fd2d4d6517b8805ff96d3c6da60.tar.gz
Qt-720d56486c3a3fd2d4d6517b8805ff96d3c6da60.tar.bz2
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.6-integration
* '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2: Remove unusable test case from QGraphicsItem benchmark. Remove unstable test case from QGraphicsItem::setTransform benchmark. Stabilize QGraphicsItem benchmarks.
Diffstat (limited to 'tests')
-rw-r--r--tests/benchmarks/gui/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp41
1 files changed, 22 insertions, 19 deletions
diff --git a/tests/benchmarks/gui/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/benchmarks/gui/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp
index ac51072..e17cf1c 100644
--- a/tests/benchmarks/gui/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp
+++ b/tests/benchmarks/gui/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp
@@ -55,6 +55,7 @@ public:
virtual ~tst_QGraphicsItem();
public slots:
+ void initTestCase();
void init();
void cleanup();
@@ -71,7 +72,6 @@ private slots:
void scale();
void shear();
void translate();
- void setRotation();
};
tst_QGraphicsItem::tst_QGraphicsItem()
@@ -82,8 +82,23 @@ tst_QGraphicsItem::~tst_QGraphicsItem()
{
}
+static inline void processEvents()
+{
+ QApplication::flush();
+ QApplication::processEvents();
+ QApplication::processEvents();
+}
+
+void tst_QGraphicsItem::initTestCase()
+{
+ QApplication::flush();
+ QTest::qWait(1500);
+ processEvents();
+}
+
void tst_QGraphicsItem::init()
{
+ processEvents();
}
void tst_QGraphicsItem::cleanup()
@@ -152,10 +167,10 @@ void tst_QGraphicsItem::setPos()
QGraphicsScene scene;
QGraphicsRectItem *rect = scene.addRect(QRectF(0, 0, 100, 100));
+ processEvents();
QBENCHMARK {
rect->setPos(10, 10);
- rect->transform(); // prevent lazy optimizing
}
}
@@ -163,7 +178,6 @@ void tst_QGraphicsItem::setTransform_data()
{
QTest::addColumn<QTransform>("transform");
- QTest::newRow("id") << QTransform();
QTest::newRow("rotate 45z") << QTransform().rotate(45);
QTest::newRow("scale 2x2") << QTransform().scale(2, 2);
QTest::newRow("translate 100, 100") << QTransform().translate(100, 100);
@@ -177,10 +191,10 @@ void tst_QGraphicsItem::setTransform()
QGraphicsScene scene;
QGraphicsRectItem *item = scene.addRect(QRectF(0, 0, 100, 100));
+ processEvents();
QBENCHMARK {
item->setTransform(transform);
- item->transform(); // prevent lazy optimizing
}
}
@@ -188,10 +202,10 @@ void tst_QGraphicsItem::rotate()
{
QGraphicsScene scene;
QGraphicsItem *item = scene.addRect(QRectF(0, 0, 100, 100));
+ processEvents();
QBENCHMARK {
item->rotate(45);
- item->transform(); // prevent lazy optimizing
}
}
@@ -199,10 +213,10 @@ void tst_QGraphicsItem::scale()
{
QGraphicsScene scene;
QGraphicsItem *item = scene.addRect(QRectF(0, 0, 100, 100));
+ processEvents();
QBENCHMARK {
item->scale(2, 2);
- item->transform(); // prevent lazy optimizing
}
}
@@ -210,10 +224,10 @@ void tst_QGraphicsItem::shear()
{
QGraphicsScene scene;
QGraphicsItem *item = scene.addRect(QRectF(0, 0, 100, 100));
+ processEvents();
QBENCHMARK {
item->shear(1.5, 1.5);
- item->transform(); // prevent lazy optimizing
}
}
@@ -221,21 +235,10 @@ void tst_QGraphicsItem::translate()
{
QGraphicsScene scene;
QGraphicsItem *item = scene.addRect(QRectF(0, 0, 100, 100));
+ processEvents();
QBENCHMARK {
item->translate(100, 100);
- item->transform(); // prevent lazy optimizing
- }
-}
-
-void tst_QGraphicsItem::setRotation()
-{
- QGraphicsScene scene;
- QGraphicsItem *item = scene.addRect(QRectF(0, 0, 100, 100));
-
- QBENCHMARK {
- item->setRotation(45);
- item->transform(); // prevent lazy optimizing
}
}