Commit 14e5df4e authored by Dmitry Kazakov's avatar Dmitry Kazakov

Fix unittest for loading SVG files

parent 418521fb
......@@ -37,6 +37,7 @@
#include <QTemporaryFile>
#include <QFileInfo>
#include <QApplication>
namespace TestUtil
{
......@@ -81,20 +82,16 @@ void testFiles(const QString& _dirname, const QStringList& exclusions, const QSt
KoColorConversionTransformation::NoOptimization);
}
QTemporaryFile tmpFile(QDir::tempPath() + QLatin1String("/krita_XXXXXX") + QLatin1String(".png"));
tmpFile.open();
doc->setFileBatchMode(true);
doc->setBackupFile(false);
doc->setOutputMimeType("image/png");
doc->saveAs(QUrl("file://" + tmpFile.fileName()));
qApp->processEvents();
doc->image()->waitForDone();
QImage sourceImage = doc->image()->projection()->convertToQImage(0, doc->image()->bounds());
QImage resultImage(resultFileInfo.absoluteFilePath());
resultImage = resultImage.convertToFormat(QImage::Format_ARGB32);
QImage sourceImage(tmpFile.fileName());
sourceImage = sourceImage.convertToFormat(QImage::Format_ARGB32);
tmpFile.close();
QPoint pt;
if (!TestUtil::compareQImages(pt, resultImage, sourceImage, fuzzy)) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment