summaryrefslogtreecommitdiffstats
path: root/tests/auto/qstatictext
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2010-02-10 16:27:07 (GMT)
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2010-02-10 16:27:07 (GMT)
commit02e9f3f25bdcc1b13ecf9ffaf43716c8f7053e88 (patch)
treee96f9f231e5d7560c133518196cc05a39e48d3c6 /tests/auto/qstatictext
parent2e8d090fa6813a2e37c9ed27d69bc3fc99a7ae35 (diff)
downloadQt-02e9f3f25bdcc1b13ecf9ffaf43716c8f7053e88.zip
Qt-02e9f3f25bdcc1b13ecf9ffaf43716c8f7053e88.tar.gz
Qt-02e9f3f25bdcc1b13ecf9ffaf43716c8f7053e88.tar.bz2
Remove fluxuating tests for QStaticText
The QGLWidget tests would fail at random. The use case has been confirmed to work through manual tests, but I haven't found any good way to test them automatically. They have been removed until time permits.
Diffstat (limited to 'tests/auto/qstatictext')
-rw-r--r--tests/auto/qstatictext/tst_qstatictext.cpp209
1 files changed, 0 insertions, 209 deletions
diff --git a/tests/auto/qstatictext/tst_qstatictext.cpp b/tests/auto/qstatictext/tst_qstatictext.cpp
index 92c0008..69e9dc5 100644
--- a/tests/auto/qstatictext/tst_qstatictext.cpp
+++ b/tests/auto/qstatictext/tst_qstatictext.cpp
@@ -74,11 +74,6 @@ private slots:
void projectedPainter();
void rotatedScaledAndTranslatedPainter();
void transformationChanged();
-
- void drawToGLWidget();
- void drawToGLWidgetRepeated();
- void drawToGLWidgetWithCaching();
- void drawToGLWidgetWithCachingRepeated();
};
void tst_QStaticText::init()
@@ -437,209 +432,5 @@ void tst_QStaticText::transformationChanged()
QCOMPARE(imageDrawStaticText, imageDrawText);
}
-class MyGLWidget: public QGLWidget
-{
-public:
- enum PaintEventType {
- NormalDrawText,
- NormalDrawStaticText,
- DrawStaticTextWithCaching
- };
-
- MyGLWidget(PaintEventType paintEventType, QWidget *parent = 0)
- : QGLWidget(parent), m_paintEventType(paintEventType)
- {
- m_staticText.setText("Lorem ipsum dolor sit amet, consectetur adipiscing elit.");
- if (m_paintEventType == DrawStaticTextWithCaching)
- m_staticText.setUseBackendOptimizations(true);
- shown = false;
- }
-
- void paintEvent(QPaintEvent *)
- {
- QPainter painter(this);
- painter.fillRect(rect(), Qt::white);
- switch (m_paintEventType) {
- case NormalDrawStaticText:
- case DrawStaticTextWithCaching:
- painter.drawStaticText(QPointF(11, 12), m_staticText);
- break;
- case NormalDrawText:
- painter.drawText(11, 12, "Lorem ipsum dolor sit amet, consectetur adipiscing elit.");
- break;
- };
- shown = true;
- }
-
- bool shown;
-
-private:
- QStaticText m_staticText;
- PaintEventType m_paintEventType;
-};
-
-void tst_QStaticText::drawToGLWidget()
-{
- QImage imageDrawText;
- {
- MyGLWidget glWidget(MyGLWidget::NormalDrawText);
- glWidget.show();
- while (!glWidget.shown)
- QApplication::processEvents();
- imageDrawText = glWidget.grabFrameBuffer();
- }
-
- QImage imageDrawStaticText;
- {
- MyGLWidget glWidget(MyGLWidget::NormalDrawStaticText);
- glWidget.show();
- while (!glWidget.shown)
- QApplication::processEvents();
- imageDrawStaticText = glWidget.grabFrameBuffer();
- }
-
-#if defined(DEBUG_SAVE_IMAGE)
- imageDrawText.save("drawToGLWidget_imageDrawText.png");
- imageDrawStaticText.save("drawToGLWidget_imageDrawStaticText.png");
-#endif
-
- QCOMPARE(imageDrawStaticText, imageDrawText);
-}
-
-void tst_QStaticText::drawToGLWidgetWithCaching()
-{
- QImage imageDrawText;
- {
- MyGLWidget glWidget(MyGLWidget::NormalDrawText);
- glWidget.show();
- while (!glWidget.shown)
- QApplication::processEvents();
- imageDrawText = glWidget.grabFrameBuffer();
- }
-
- QImage imageDrawStaticText;
- {
- MyGLWidget glWidget(MyGLWidget::DrawStaticTextWithCaching);
- glWidget.show();
- while (!glWidget.shown)
- QApplication::processEvents();
- imageDrawStaticText = glWidget.grabFrameBuffer();
- }
-
-#if defined(DEBUG_SAVE_IMAGE)
- imageDrawText.save("drawToGLWidgetWithCaching_imageDrawText.png");
- imageDrawStaticText.save("drawToGLWidgetWithCaching_imageDrawStaticText.png");
-#endif
-
- QCOMPARE(imageDrawStaticText, imageDrawText);
-}
-
-void tst_QStaticText::drawToGLWidgetWithCachingRepeated()
-{
- QImage imageDrawText;
- MyGLWidget glWidgetNormal(MyGLWidget::NormalDrawText);
-
- {
- glWidgetNormal.show();
- while (!glWidgetNormal.shown)
- QApplication::processEvents();
- imageDrawText = glWidgetNormal.grabFrameBuffer();
- }
-
- QImage imageDrawStaticText;
- MyGLWidget glWidgetAbnormal(MyGLWidget::DrawStaticTextWithCaching);
- {
-
- glWidgetAbnormal.show();
- while (!glWidgetAbnormal.shown)
- QApplication::processEvents();
- imageDrawStaticText = glWidgetAbnormal.grabFrameBuffer();
- }
-
-#if defined(DEBUG_SAVE_IMAGE)
- imageDrawText.save("drawToGLWidgetWithCachingRepeated_imageDrawText1.png");
- imageDrawStaticText.save("drawToGLWidgetWithCachingRepeated_imageDrawStaticText1.png");
-#endif
-
- QCOMPARE(imageDrawStaticText, imageDrawText);
-
- {
- glWidgetNormal.shown = false;
- glWidgetNormal.update();
- while (!glWidgetNormal.shown)
- QApplication::processEvents();
- imageDrawText = glWidgetNormal.grabFrameBuffer();
- }
-
- {
- glWidgetAbnormal.shown = false;
- glWidgetAbnormal.update();
- while (!glWidgetAbnormal.shown)
- QApplication::processEvents();
- imageDrawStaticText = glWidgetAbnormal.grabFrameBuffer();
- }
-
-#if defined(DEBUG_SAVE_IMAGE)
- imageDrawText.save("drawToGLWidgetWithCachingRepeated_imageDrawText2.png");
- imageDrawStaticText.save("drawToGLWidgetWithCachingRepeated_imageDrawStaticText2.png");
-#endif
-
- QCOMPARE(imageDrawStaticText, imageDrawText);
-}
-
-void tst_QStaticText::drawToGLWidgetRepeated()
-{
- QImage imageDrawText;
- MyGLWidget glWidgetNormal(MyGLWidget::NormalDrawText);
-
- {
- glWidgetNormal.show();
- while (!glWidgetNormal.shown)
- QApplication::processEvents();
- imageDrawText = glWidgetNormal.grabFrameBuffer();
- }
-
- QImage imageDrawStaticText;
- MyGLWidget glWidgetAbnormal(MyGLWidget::NormalDrawStaticText);
- {
-
- glWidgetAbnormal.show();
- while (!glWidgetAbnormal.shown)
- QApplication::processEvents();
- imageDrawStaticText = glWidgetAbnormal.grabFrameBuffer();
- }
-
-#if defined(DEBUG_SAVE_IMAGE)
- imageDrawText.save("drawToGLWidgetWithCachingRepeated_imageDrawText1.png");
- imageDrawStaticText.save("drawToGLWidgetWithCachingRepeated_imageDrawStaticText1.png");
-#endif
-
- QCOMPARE(imageDrawStaticText, imageDrawText);
-
- {
- glWidgetNormal.shown = false;
- glWidgetNormal.update();
- while (!glWidgetNormal.shown)
- QApplication::processEvents();
- imageDrawText = glWidgetNormal.grabFrameBuffer();
- }
-
- {
- glWidgetAbnormal.shown = false;
- glWidgetAbnormal.update();
- while (!glWidgetAbnormal.shown)
- QApplication::processEvents();
- imageDrawStaticText = glWidgetAbnormal.grabFrameBuffer();
- }
-
-#if defined(DEBUG_SAVE_IMAGE)
- imageDrawText.save("drawToGLWidgetWithCachingRepeated_imageDrawText2.png");
- imageDrawStaticText.save("drawToGLWidgetWithCachingRepeated_imageDrawStaticText2.png");
-#endif
-
- QCOMPARE(imageDrawStaticText, imageDrawText);
-}
-
-
QTEST_MAIN(tst_QStaticText)
#include "tst_qstatictext.moc"