summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qstatictext/tst_qstatictext.cpp30
1 files changed, 29 insertions, 1 deletions
diff --git a/tests/auto/qstatictext/tst_qstatictext.cpp b/tests/auto/qstatictext/tst_qstatictext.cpp
index 68f05c1..b6b4e83 100644
--- a/tests/auto/qstatictext/tst_qstatictext.cpp
+++ b/tests/auto/qstatictext/tst_qstatictext.cpp
@@ -46,12 +46,17 @@
#include <qstatictext.h>
#include <private/qstatictext_p.h>
+#include <private/qapplication_p.h>
// #define DEBUG_SAVE_IMAGE
class tst_QStaticText: public QObject
{
Q_OBJECT
+
+private:
+ bool supportsTransformations() const;
+
private slots:
void init();
void cleanup();
@@ -177,6 +182,8 @@ void tst_QStaticText::prepareToCorrectData()
p.drawStaticText(QPointF(11, 12), text);
}
+ if (!supportsTransformations())
+ QEXPECT_FAIL("", "Graphics system does not support transformed text on this platform", Abort);
QCOMPARE(imageDrawStaticText, imageDrawText);
}
@@ -288,6 +295,20 @@ void tst_QStaticText::translatedPainter()
QCOMPARE(imageDrawStaticText, imageDrawText);
}
+bool tst_QStaticText::supportsTransformations() const
+{
+
+ if (QApplicationPrivate::graphics_system_name == QLatin1String("opengl"))
+ return false;
+
+#if !defined(Q_WS_WIN)
+ if (QApplicationPrivate::graphics_system_name == "raster")
+ return false;
+#endif
+
+ return true;
+}
+
void tst_QStaticText::rotatedPainter()
{
QPixmap imageDrawText(1000, 1000);
@@ -314,6 +335,8 @@ void tst_QStaticText::rotatedPainter()
imageDrawStaticText.save("rotatedPainter_imageDrawStaticText.png");
#endif
+ if (!supportsTransformations())
+ QEXPECT_FAIL("", "Graphics system does not support transformed text on this platform", Abort);
QCOMPARE(imageDrawStaticText, imageDrawText);
}
@@ -340,6 +363,8 @@ void tst_QStaticText::scaledPainter()
p.drawStaticText(QPointF(11, 12), text);
}
+ if (!supportsTransformations())
+ QEXPECT_FAIL("", "Graphics system does not support transformed text on this platform", Abort);
QCOMPARE(imageDrawStaticText, imageDrawText);
}
@@ -370,7 +395,6 @@ void tst_QStaticText::projectedPainter()
}
QCOMPARE(imageDrawStaticText, imageDrawText);
-
}
void tst_QStaticText::rotatedScaledAndTranslatedPainter()
@@ -405,6 +429,8 @@ void tst_QStaticText::rotatedScaledAndTranslatedPainter()
imageDrawStaticText.save("rotatedScaledAndPainter_imageDrawStaticText.png");
#endif
+ if (!supportsTransformations())
+ QEXPECT_FAIL("", "Graphics system does not support transformed text on this platform", Abort);
QCOMPARE(imageDrawStaticText, imageDrawText);
}
@@ -444,6 +470,8 @@ void tst_QStaticText::transformationChanged()
imageDrawStaticText.save("transformationChanged_imageDrawStaticText.png");
#endif
+ if (!supportsTransformations())
+ QEXPECT_FAIL("", "Graphics system does not support transformed text on this platform", Abort);
QCOMPARE(imageDrawStaticText, imageDrawText);
}