summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets
diff options
context:
space:
mode:
authorJason McDonald <jason.mcdonald@nokia.com>2011-10-31 15:21:42 +1000
committerQt by Nokia <qt-info@nokia.com>2011-10-31 08:31:24 +0100
commitfd672569e4ba045766713b121fe16472ef2d3f8e (patch)
treee811ac3cbe83090039d8f0551977764a7fda22d0 /tests/auto/widgets
parent35d75fac0ac98b54b630870eb166321d945572e6 (diff)
Remove unstable test from qgraphicsscene test.
The removed test was disabled in February 2007 because it did not work cross-platform. The comment that was added at the time claims that the functionality is covered thoroughly by other tests, but even if that isn't true we're not losing anything by removing this test as it is not even useful as a starting-point for a new test due to its reliance on random test data. Change-Id: Ica74262082184908d02595702486803d1efff4d2 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Diffstat (limited to 'tests/auto/widgets')
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp77
1 files changed, 0 insertions, 77 deletions
diff --git a/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp b/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp
index db44876fd8..be9da88246 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp
@@ -207,7 +207,6 @@ private slots:
void items_QPolygonF_2();
void items_QPainterPath();
void items_QPainterPath_2();
- void selection();
void selectionChanged();
void selectionChanged2();
void addItem();
@@ -916,82 +915,6 @@ void tst_QGraphicsScene::items_QPainterPath_2()
QCOMPARE(scene.items(p6, Qt::ContainsItemBoundingRect).first(), ellipse);
}
-void tst_QGraphicsScene::selection()
-{
- // ### This test is difficult to make work for all platforms; instead, a
- // hand crafted data set would make it stable. Its behavior is thoroughly
- // covered by other tests. Todo: Fix this test.
-
- /*
- QGraphicsScene scene;
- QMap<QGraphicsItem *, int> itemIndexes;
- for (int i = 0; i < 256; ++i) {
- QPainterPath path;
- path.addRect(randomX[i], randomY[i], 25, 25);
-
- QGraphicsPathItem *pathItem = scene.addPath(path);
- pathItem->setFlag(QGraphicsItem::ItemIsSelectable);
- itemIndexes.insert(pathItem, i);
- }
-
-#if 0
- // Write data
- QFile::remove("graphicsScene_selection.data");
- QFile file("graphicsScene_selection.data");
- if (!file.open(QFile::WriteOnly))
- QFAIL("Unable to generate data file graphicsScene_selection.data");
- QDataStream stream(&file);
- for (qreal y = -1000; y < 1000; y += 33) {
- for (qreal x = -1000; x < 1000; x += 33) {
- for (qreal size = 1; size < 200; size += 33) {
- QPainterPath path;
- path.addRect(QRectF(x, y, size, size));
- scene.setSelectionArea(path);
- QCOMPARE(scene.selectionArea(), path);
-
- QList<int> indexes;
- foreach (QGraphicsItem *item, scene.selectedItems())
- indexes << itemIndexes.value(item);
-
- stream << x << y << size << indexes;
- }
- }
- }
-#else
- // Read data
- QFile file("graphicsScene_selection.data");
- if (!file.open(QFile::ReadOnly))
- QFAIL("Unable to load data file graphicsScene_selection.data");
-
- QDataStream stream(&file);
-
- while (!stream.atEnd()) {
- QList<int> expectedIndexes;
-
- qreal x, y, size;
- stream >> x >> y >> size >> expectedIndexes;
-
- QPainterPath path;
- path.addRect(QRectF(x, y, size, size));
- scene.setSelectionArea(path);
- QCOMPARE(scene.selectionArea(), path);
-
- QList<int> indexes;
- foreach (QGraphicsItem *item, scene.selectedItems())
- indexes << itemIndexes.value(item);
-
- qSort(indexes);
- qSort(expectedIndexes);
-
- QCOMPARE(indexes, expectedIndexes);
-
- scene.clearSelection();
- QVERIFY(scene.selectedItems().isEmpty());
- }
-#endif
- */
-}
-
class CustomView : public QGraphicsView
{
public: