summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-07-21 23:52:06 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-07-21 23:52:06 (GMT)
commitc70e3f24a97b82f5ce9ad890fa95369e425a31ac (patch)
tree432987220d2f7fa2b96a5307d0d8608e7eb184be /tests
parent07f131927faa09402589da7b4bfb516482f59e46 (diff)
parentc05f38f37fbe2192d135881de3dba087ac71ffe1 (diff)
downloadQt-c70e3f24a97b82f5ce9ad890fa95369e425a31ac.zip
Qt-c70e3f24a97b82f5ce9ad890fa95369e425a31ac.tar.gz
Qt-c70e3f24a97b82f5ce9ad890fa95369e425a31ac.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1: Revert "Compile fix for MSVC" Compile fix for MSVC Improve QAccessible for QAccessibleTabBar Improve QAccessible for QTabBar fix the export macros for the QtDBus module rebuild configure.exe make "configure -qt-gif" work again on Windows Fix a typo in harfbuzz thai line breaking. Ensure that font sizes that are > 0 and < 1 are still respected
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qsvgrenderer/tst_qsvgrenderer.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/auto/qsvgrenderer/tst_qsvgrenderer.cpp b/tests/auto/qsvgrenderer/tst_qsvgrenderer.cpp
index 106fd8c..519f4f5 100644
--- a/tests/auto/qsvgrenderer/tst_qsvgrenderer.cpp
+++ b/tests/auto/qsvgrenderer/tst_qsvgrenderer.cpp
@@ -85,6 +85,7 @@ private slots:
void testFillInheritance();
void testStopOffsetOpacity();
void testUseElement();
+ void smallFont();
#ifndef QT_NO_COMPRESS
void testGzLoading();
@@ -1342,5 +1343,30 @@ void tst_QSvgRenderer::testUseElement()
}
}
+void tst_QSvgRenderer::smallFont()
+{
+ static const char *svgs[] = { "<svg width=\"50px\" height=\"50px\"><text x=\"10\" y=\"10\" font-size=\"0\">Hello world</text></svg>",
+ "<svg width=\"50px\" height=\"50px\"><text x=\"10\" y=\"10\" font-size=\"0.5\">Hello world</text></svg>"
+ };
+ const int COUNT = sizeof(svgs) / sizeof(svgs[0]);
+ QImage images[COUNT];
+ QPainter p;
+
+ for (int i = 0; i < COUNT; ++i) {
+ QByteArray data(svgs[i]);
+ if (i == 0) {
+ QTest::ignoreMessage(QtWarningMsg, "QFont::setPointSizeF: Point size <= 0 (0.000000), must be greater than 0");
+ QTest::ignoreMessage(QtWarningMsg, "QFont::setPointSize: Point size <= 0 (0), must be greater than 0");
+ }
+ QSvgRenderer renderer(data);
+ images[i] = QImage(50, 50, QImage::Format_ARGB32_Premultiplied);
+ images[i].fill(-1);
+ p.begin(&images[i]);
+ renderer.render(&p);
+ p.end();
+ }
+ QVERIFY(images[0] != images[1]);
+}
+
QTEST_MAIN(tst_QSvgRenderer)
#include "tst_qsvgrenderer.moc"