[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    koffice/krita
From:       Boudewijn Rempt <boud () valdyas ! org>
Date:       2010-11-12 9:07:00
Message-ID: 20101112090700.E6C28AC89E () svn ! kde ! org
[Download RAW message or body]

SVN commit 1195870 by rempt:

Fix jpeg unittest

Patch by Lukas Tvrdy.

 M  +10 -0     plugins/formats/jpeg/tests/kis_jpeg_test.cpp  
 M  +3 -3      sdk/tests/filestest.h  
 M  +1 -1      sdk/tests/testutil.h  


--- trunk/koffice/krita/plugins/formats/jpeg/tests/kis_jpeg_test.cpp #1195869:1195870
@@ -25,15 +25,25 @@
 #include <qtest_kde.h>
 
 #include "filestest.h"
+#include "jpeglib.h"
 
 #ifndef FILES_DATA_DIR
 #error "FILES_DATA_DIR not set. A directory with the data used for testing the importing of files in \
krita"  #endif
 
+#ifndef JPEG_LIB_VERSION
+#error "JPEG_LIB_VERSION not set. libjpeg should set it."
+#endif
+
 void KisJpegTest::testFiles()
 {
+    if (JPEG_LIB_VERSION == 80){
+        TestUtil::testFiles(QString(FILES_DATA_DIR) + "/sources", QStringList(), "_80");
+    }else {
     TestUtil::testFiles(QString(FILES_DATA_DIR) + "/sources", QStringList());
 }
+
+}
 QTEST_KDEMAIN(KisJpegTest, GUI)
 
 #include "kis_jpeg_test.moc"
--- trunk/koffice/krita/sdk/tests/filestest.h #1195869:1195870
@@ -39,11 +39,12 @@
 #include <KoColorSpaceRegistry.h>
 
 #include <ktemporaryfile.h>
+#include <QtCore/qfileinfo.h>
 
 namespace TestUtil
 {
 
-void testFiles(const QString& _dirname, const QStringList& exclusions)
+void testFiles(const QString& _dirname, const QStringList& exclusions, const QString &resultSuffix = \
QString())  {
     QDir dirSources(_dirname);
     QStringList failuresFileInfo;
@@ -55,8 +56,7 @@
             continue;
         }
         if (!sourceFileInfo.isHidden() && !sourceFileInfo.isDir()) {
-            qDebug() << "handling " << sourceFileInfo.fileName();
-            QFileInfo resultFileInfo(QString(FILES_DATA_DIR) + "/results/" + sourceFileInfo.fileName() + \
".png"); +            QFileInfo resultFileInfo(QString(FILES_DATA_DIR) + "/results/" + \
sourceFileInfo.fileName() + resultSuffix + ".png");  
             if (!resultFileInfo.exists()) {
                 failuresFileInfo << resultFileInfo.fileName();
--- trunk/koffice/krita/sdk/tests/testutil.h #1195869:1195870
@@ -81,7 +81,7 @@
     if (w1 != w2 || h1 != h2) {
         pt.setX(-1);
         pt.setY(-1);
-        qDebug() << "Images have different sizes";
+        qDebug() << "Images have different sizes" << image1.size() << image2.size();
         return false;
     }
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic