summaryrefslogtreecommitdiffstats
path: root/tests/auto/qgraphicssceneindex
diff options
context:
space:
mode:
authorAriya Hidayat <ariya.hidayat@trolltech.com>2009-03-16 12:54:20 (GMT)
committerAlexis Menard <alexis.menard@trolltech.com>2009-04-07 18:14:13 (GMT)
commit14785a965fc475d220ca8592c6ee4a44a0be25f6 (patch)
tree366da45e52e3aaa6fa62c0778dda3e05b4caf78d /tests/auto/qgraphicssceneindex
parentd5ab1562ea7b8ce8e94e8db9ea2a7fcab17f657f (diff)
downloadQt-14785a965fc475d220ca8592c6ee4a44a0be25f6.zip
Qt-14785a965fc475d220ca8592c6ee4a44a0be25f6.tar.gz
Qt-14785a965fc475d220ca8592c6ee4a44a0be25f6.tar.bz2
Fixes: Parametrize the test with potentially different indexing method.
Diffstat (limited to 'tests/auto/qgraphicssceneindex')
-rw-r--r--tests/auto/qgraphicssceneindex/tst_qgraphicssceneindex.cpp28
1 files changed, 27 insertions, 1 deletions
diff --git a/tests/auto/qgraphicssceneindex/tst_qgraphicssceneindex.cpp b/tests/auto/qgraphicssceneindex/tst_qgraphicssceneindex.cpp
index 209e4be..f2a2bf1 100644
--- a/tests/auto/qgraphicssceneindex/tst_qgraphicssceneindex.cpp
+++ b/tests/auto/qgraphicssceneindex/tst_qgraphicssceneindex.cpp
@@ -44,7 +44,6 @@
#include <QtGui/qgraphicssceneindex.h>
#include <private/qgraphicsscene_bsp_p.h>
-#include <QtGui>
//TESTED_CLASS=
//TESTED_FILES=
@@ -56,13 +55,40 @@ public slots:
void initTestCase();
private slots:
+ void sceneRect_data();
void sceneRect();
+
+private:
+ void common_data();
+ QGraphicsSceneIndex *createIndex(const QString &name);
};
void tst_QGraphicsSceneIndex::initTestCase()
{
}
+void tst_QGraphicsSceneIndex::common_data()
+{
+ QTest::addColumn<QString>("indexMethod");
+
+ QTest::newRow("BSP") << QString("bsp");
+}
+
+QGraphicsSceneIndex *tst_QGraphicsSceneIndex::createIndex(const QString &indexMethod)
+{
+ QGraphicsSceneIndex *index = 0;
+
+ if (indexMethod == "bsp")
+ index = new QGraphicsSceneBspTree;
+
+ return index;
+}
+
+void tst_QGraphicsSceneIndex::sceneRect_data()
+{
+ common_data();
+}
+
void tst_QGraphicsSceneIndex::sceneRect()
{
QGraphicsSceneIndex *index = new QGraphicsSceneBspTree;