diff --git a/tests/auto/CMakeLists.txt b/tests/auto/CMakeLists.txt --- a/tests/auto/CMakeLists.txt +++ b/tests/auto/CMakeLists.txt @@ -26,10 +26,10 @@ gv_add_unit_test(imagescalertest testutils.cpp) gv_add_unit_test(paintutilstest) -# gv_add_unit_test(documenttest testutils.cpp) +gv_add_unit_test(documenttest testutils.cpp) gv_add_unit_test(transformimageoperationtest) gv_add_unit_test(jpegcontenttest) -# gv_add_unit_test(thumbnailprovidertest testutils.cpp) +gv_add_unit_test(thumbnailprovidertest testutils.cpp) if (NOT GWENVIEW_SEMANTICINFO_BACKEND_NONE) gv_add_unit_test(semanticinfobackendtest) endif() diff --git a/tests/auto/documenttest.cpp b/tests/auto/documenttest.cpp --- a/tests/auto/documenttest.cpp +++ b/tests/auto/documenttest.cpp @@ -25,7 +25,7 @@ // KDE #include #include -#include +#include #include #include @@ -85,7 +85,7 @@ QUrl url = urlForTestFile(fileName); // testing RAW loading. For raw, QImage directly won't work -> load it using KDCRaw - QByteArray mFormatHint = url.fileName().section('.', -1).toAscii().toLower(); + QByteArray mFormatHint = url.fileName().section('.', -1).toLocal8Bit().toLower(); if (KDcrawIface::KDcraw::rawFilesList().contains(QString(mFormatHint))) { if (!KDcrawIface::KDcraw::loadEmbeddedPreview(expectedImage, url.toLocalFile())) { QSKIP("Not running this test: failed to get expectedImage. Try running ./fetch_testing_raw.sh\ @@ -270,7 +270,7 @@ url = url.adjusted(QUrl::StripTrailingSlash); url.setPath(url.path() + '/' + "test.png"); - QVERIFY2(KIO::NetAccess::exists(url, KIO::NetAccess::SourceSide, 0), "test url not found"); + QVERIFY2(KIO::stat(url, KIO::StatJob::SourceSide, 0)->exec(), "test url not found"); Document::Ptr doc = DocumentFactory::instance()->load(url); doc->startLoadingFullImage(); diff --git a/tests/auto/thumbnailprovidertest.cpp b/tests/auto/thumbnailprovidertest.cpp --- a/tests/auto/thumbnailprovidertest.cpp +++ b/tests/auto/thumbnailprovidertest.cpp @@ -73,8 +73,9 @@ void SandBox::copyTestImage(const QString& testFileName, int width, int height) { - QString testPath = pathForTestFile(testFileName); - KIO::Job* job = KIO::copy(testPath, QUrl(mPath + '/' + testFileName)); + QUrl testPath = urlForTestFile(testFileName); + QUrl testDest = QUrl("file://" + mPath + '/' + testFileName); + KIO::Job* job = KIO::copy(testPath, testDest); QVERIFY2(job->exec(), "Couldn't copy test image"); mSizeHash.insert(testFileName, QSize(width, height)); }