diff options
author | Liang Qi <liang.qi@qt.io> | 2016-11-15 09:51:41 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2016-11-15 09:58:16 +0100 |
commit | 9808b53fde1dfc65ad3757cc6720e430c3cc89a2 (patch) | |
tree | a0517ae1e290e7bbdb118c9f01f4e6e5d744998c /tests/auto/gui/image/qpixmap | |
parent | c214379156e4c75dcfe59cf73d69b912f4293303 (diff) | |
parent | 246fe271878dbe586b5f3222a78d67dfecd1ca83 (diff) | |
download | qtbase-9808b53fde1dfc65ad3757cc6720e430c3cc89a2.tar.gz |
Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts:
configure
src/plugins/platforms/eglfs/qeglfsintegration.cpp
src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp
Change-Id: Id2da7c775439adb62646d5b741ee7c638042b34b
Diffstat (limited to 'tests/auto/gui/image/qpixmap')
-rw-r--r-- | tests/auto/gui/image/qpixmap/tst_qpixmap.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp b/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp index 8dc6f901e6..8df8c2d3b6 100644 --- a/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp +++ b/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp @@ -162,6 +162,7 @@ private: const QString m_prefix; const QString m_convertFromImage; const QString m_loadFromData; + const QTemporaryDir m_tempDir; }; static bool lenientCompare(const QPixmap &actual, const QPixmap &expected) @@ -209,11 +210,11 @@ void tst_QPixmap::initTestCase() QVERIFY(!m_prefix.isEmpty()); QVERIFY(!m_convertFromImage.isEmpty()); QVERIFY(!m_loadFromData.isEmpty()); + QVERIFY2(m_tempDir.isValid(), qPrintable(m_tempDir.errorString())); } void tst_QPixmap::cleanupTestCase() { - QFile::remove(QLatin1String("temp_image.png")); } void tst_QPixmap::swap() @@ -1455,18 +1456,18 @@ void tst_QPixmap::preserveDepth() void tst_QPixmap::loadAsBitmapOrPixmap() { QImage tmp(10, 10, QImage::Format_RGB32); - tmp.save("temp_image.png"); + tmp.save(m_tempDir.path() + "/temp_image.png"); bool ok; // Check that we can load the pixmap as a pixmap and that it then turns into a pixmap - QPixmap pixmap("temp_image.png"); + QPixmap pixmap(m_tempDir.path() + "/temp_image.png"); QVERIFY(!pixmap.isNull()); QVERIFY(pixmap.depth() > 1); QVERIFY(!pixmap.isQBitmap()); pixmap = QPixmap(); - ok = pixmap.load("temp_image.png"); + ok = pixmap.load(m_tempDir.path() + "/temp_image.png"); QVERIFY(ok); QVERIFY(!pixmap.isNull()); QVERIFY(pixmap.depth() > 1); @@ -1474,20 +1475,20 @@ void tst_QPixmap::loadAsBitmapOrPixmap() //now we can try to load it without an extension pixmap = QPixmap(); - ok = pixmap.load("temp_image"); + ok = pixmap.load(m_tempDir.path() + "/temp_image"); QVERIFY(ok); QVERIFY(!pixmap.isNull()); QVERIFY(pixmap.depth() > 1); QVERIFY(!pixmap.isQBitmap()); // The do the same check for bitmaps.. - QBitmap bitmap("temp_image.png"); + QBitmap bitmap(m_tempDir.path() + "/temp_image.png"); QVERIFY(!bitmap.isNull()); QCOMPARE(bitmap.depth(), 1); QVERIFY(bitmap.isQBitmap()); bitmap = QBitmap(); - ok = bitmap.load("temp_image.png"); + ok = bitmap.load(m_tempDir.path() + "/temp_image.png"); QVERIFY(ok); QVERIFY(!bitmap.isNull()); QCOMPARE(bitmap.depth(), 1); |