diff options
Diffstat (limited to 'tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp')
-rw-r--r-- | tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp b/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp index 1c2597a1f2..222e0e6db0 100644 --- a/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp +++ b/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp @@ -70,15 +70,15 @@ static inline QString testSuiteWarning() QString result; QTextStream str(&result); - str << "\nCannot find the shared-mime-info test suite\nstarting from: " + str << "\nCannot find the shared-mime-info test suite\nin the parent of: " << QDir::toNativeSeparators(QDir::currentPath()) << "\n" "cd " << QDir::toNativeSeparators(QStringLiteral("tests/auto/corelib/mimetypes/qmimedatabase")) << "\n" - "wget https://gitlab.freedesktop.org/xdg/shared-mime-info/-/archive/Release-1-10/shared-mime-info-Release-1-10.zip\n" - "unzip shared-mime-info-Release-1-10.zip\n"; + "wget https://gitlab.freedesktop.org/xdg/shared-mime-info/-/archive/2.1/shared-mime-info-2.1.zip\n" + "unzip shared-mime-info-2.1.zip\n"; #ifdef Q_OS_WIN - str << "mkdir testfiles\nxcopy /s shared-mime-info-Release-1-10 s-m-i\n"; + str << "mkdir testfiles\nxcopy /s shared-mime-info-2.1 s-m-i\n"; #else - str << "ln -s shared-mime-info-Release-1-10 s-m-i\n"; + str << "ln -s shared-mime-info-2.1 s-m-i\n"; #endif return result; } @@ -154,7 +154,7 @@ void tst_QMimeDatabase::initTestCase() QVERIFY2(copyResourceFile(xmlFileName, xmlTargetFileName, &errorMessage), qPrintable(errorMessage)); #endif - m_testSuite = QFINDTESTDATA("s-m-i/tests"); + m_testSuite = QFINDTESTDATA("../s-m-i/tests/mime-detection"); if (m_testSuite.isEmpty()) qWarning("%s", qPrintable(testSuiteWarning())); @@ -611,7 +611,7 @@ void tst_QMimeDatabase::allMimeTypes() QVERIFY(!lst.isEmpty()); // Hardcoding this is the only way to check both providers find the same number of mimetypes. - QCOMPARE(lst.count(), 779); + QCOMPARE(lst.count(), 811); foreach (const QMimeType &mime, lst) { const QString name = mime.name(); @@ -631,10 +631,9 @@ void tst_QMimeDatabase::suffixes_data() QTest::newRow("mimetype with a single pattern") << "application/pdf" << "*.pdf" << "pdf"; QTest::newRow("mimetype with multiple patterns") << "application/x-kpresenter" << "*.kpr;*.kpt" << "kpr"; - QTest::newRow("jpeg") << "image/jpeg" << "*.jpe;*.jpg;*.jpeg" << "jpeg"; - //if (KMimeType::sharedMimeInfoVersion() > KDE_MAKE_VERSION(0, 60, 0)) { - QTest::newRow("mimetype with many patterns") << "application/vnd.wordperfect" << "*.wp;*.wp4;*.wp5;*.wp6;*.wpd;*.wpp" << "wp"; - //} + // The preferred suffix for image/jpeg is *.jpg, as per https://bugs.kde.org/show_bug.cgi?id=176737 + QTest::newRow("jpeg") << "image/jpeg" << "*.jpe;*.jpg;*.jpeg" << "jpg"; + QTest::newRow("mimetype with many patterns") << "application/vnd.wordperfect" << "*.wp;*.wp4;*.wp5;*.wp6;*.wpd;*.wpp" << "wp"; QTest::newRow("oasis text mimetype") << "application/vnd.oasis.opendocument.text" << "*.odt" << "odt"; QTest::newRow("oasis presentation mimetype") << "application/vnd.oasis.opendocument.presentation" << "*.odp" << "odp"; QTest::newRow("mimetype with multiple patterns") << "text/plain" << "*.asc;*.txt;*,v" << "txt"; |