diff options
Diffstat (limited to 'tests/auto/gui')
-rw-r--r-- | tests/auto/gui/image/qimage/qimage.pro | 2 | ||||
-rw-r--r-- | tests/auto/gui/image/qimagereader/qimagereader.pro | 2 | ||||
-rw-r--r-- | tests/auto/gui/image/qimagewriter/qimagewriter.pro | 2 | ||||
-rw-r--r-- | tests/auto/gui/kernel/qwindow/BLACKLIST | 2 | ||||
-rw-r--r-- | tests/auto/gui/painting/qpainter/qpainter.pro | 2 | ||||
-rw-r--r-- | tests/auto/gui/text/qrawfont/tst_qrawfont.cpp | 39 |
6 files changed, 44 insertions, 5 deletions
diff --git a/tests/auto/gui/image/qimage/qimage.pro b/tests/auto/gui/image/qimage/qimage.pro index 39ce4e26cb..56618e0bfa 100644 --- a/tests/auto/gui/image/qimage/qimage.pro +++ b/tests/auto/gui/image/qimage/qimage.pro @@ -5,6 +5,6 @@ SOURCES += tst_qimage.cpp QT += core-private gui-private testlib qtConfig(c++11): CONFIG += c++11 -android: RESOURCES+=qimage.qrc +android:!android-embedded: RESOURCES += qimage.qrc TESTDATA += images/* diff --git a/tests/auto/gui/image/qimagereader/qimagereader.pro b/tests/auto/gui/image/qimagereader/qimagereader.pro index 3d35bf59da..b06f56dddf 100644 --- a/tests/auto/gui/image/qimagereader/qimagereader.pro +++ b/tests/auto/gui/image/qimagereader/qimagereader.pro @@ -5,7 +5,7 @@ MOC_DIR=tmp QT += core-private gui-private network testlib RESOURCES += qimagereader.qrc -android { +android:!android-embedded { RESOURCES += android_testdata.qrc } diff --git a/tests/auto/gui/image/qimagewriter/qimagewriter.pro b/tests/auto/gui/image/qimagewriter/qimagewriter.pro index 34adedd187..e63e57886c 100644 --- a/tests/auto/gui/image/qimagewriter/qimagewriter.pro +++ b/tests/auto/gui/image/qimagewriter/qimagewriter.pro @@ -3,5 +3,5 @@ TARGET = tst_qimagewriter QT += testlib SOURCES += tst_qimagewriter.cpp MOC_DIR=tmp -android: RESOURCES+= qimagewriter.qrc +android:!android-embedded: RESOURCES += qimagewriter.qrc TESTDATA += images/* diff --git a/tests/auto/gui/kernel/qwindow/BLACKLIST b/tests/auto/gui/kernel/qwindow/BLACKLIST index 4469b98953..05cf1b5a30 100644 --- a/tests/auto/gui/kernel/qwindow/BLACKLIST +++ b/tests/auto/gui/kernel/qwindow/BLACKLIST @@ -1,5 +1,5 @@ [positioning:default] -ubuntu-16.04 +linux osx-10.12 ci [positioning:fake] osx-10.12 ci diff --git a/tests/auto/gui/painting/qpainter/qpainter.pro b/tests/auto/gui/painting/qpainter/qpainter.pro index 0d3899ee92..9ccf8f20ba 100644 --- a/tests/auto/gui/painting/qpainter/qpainter.pro +++ b/tests/auto/gui/painting/qpainter/qpainter.pro @@ -9,7 +9,7 @@ SOURCES += tst_qpainter.cpp TESTDATA += drawEllipse/* drawLine_rop_bitmap/* drawPixmap_rop/* drawPixmap_rop_bitmap/* \ task217400.png -android { +android:!android-embedded { RESOURCES += \ testdata.qrc } diff --git a/tests/auto/gui/text/qrawfont/tst_qrawfont.cpp b/tests/auto/gui/text/qrawfont/tst_qrawfont.cpp index 37f94d0278..373ad7fef9 100644 --- a/tests/auto/gui/text/qrawfont/tst_qrawfont.cpp +++ b/tests/auto/gui/text/qrawfont/tst_qrawfont.cpp @@ -93,6 +93,9 @@ private slots: void fallbackFontsOrder(); + void qtbug65923_partal_clone_data(); + void qtbug65923_partal_clone(); + private: QString testFont; QString testFontBoldItalic; @@ -1044,6 +1047,42 @@ void tst_QRawFont::fallbackFontsOrder() fontDatabase.removeApplicationFont(id); } +void tst_QRawFont::qtbug65923_partal_clone_data() +{ + QTest::addColumn<bool>("shouldClone"); + + QTest::newRow("Without cloning font engine") << false; + QTest::newRow("Cloning font engine") << true; +} + +void tst_QRawFont::qtbug65923_partal_clone() +{ + QFile file(testFont); + file.open(QIODevice::ReadOnly); + QByteArray fontData = file.readAll(); + + QRawFont outerFont; + + { + QRawFont innerFont(fontData, 16, QFont::PreferDefaultHinting); + + QFETCH(bool, shouldClone); + if (shouldClone) { + // This will trigger QFontEngine::cloneWithSize + innerFont.setPixelSize(innerFont.pixelSize() + 1); + } + + outerFont = innerFont; + } + + // This will detach if data is shared with the raw font. If the raw font has + // a naked reference to the data, without informing Qt of it via the ref count + // of the byte array, this will result in clearing 'live' data. + fontData.fill('\0'); + + QVERIFY(!outerFont.boundingRect(42).isEmpty()); +} + #endif // QT_NO_RAWFONT QTEST_MAIN(tst_QRawFont) |