summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui/image
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2016-11-16 07:37:38 +0100
committerLiang Qi <liang.qi@qt.io>2016-11-16 12:35:36 +0100
commit90c425642dfeae4564b43dacf15f80479962e910 (patch)
tree7e51683195210b3c70c04a8a0753ee272af1cd4c /tests/auto/gui/image
parent1a43199fcea1bcec1ebf1a1a12cd3dcb942d67b4 (diff)
parent9808b53fde1dfc65ad3757cc6720e430c3cc89a2 (diff)
Merge remote-tracking branch 'origin/5.7' into 5.8
Conflicts: mkspecs/common/linux-android.conf src/gui/opengl/qopengl.h src/network/socket/qnativesocketengine_winrt.cpp src/network/socket/qnativesocketengine_winrt_p.h src/plugins/platforms/cocoa/qcocoawindow.mm src/plugins/platforms/eglfs/api/qeglfsintegration.cpp src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp sync.profile Change-Id: If70aaf2c49df91157b864cf0d7d9513546c9bec4
Diffstat (limited to 'tests/auto/gui/image')
-rw-r--r--tests/auto/gui/image/qpixmap/tst_qpixmap.cpp15
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 895f68bbd7..ad7de09c48 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()
@@ -1442,18 +1443,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);
@@ -1461,20 +1462,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);