summaryrefslogtreecommitdiff
path: root/kde-apps/ark/files/ark-23.08.2-dont-hardcode-bzip2-mimetype-in-tests.patch
blob: fad87b4114efa6a24b04b602124d717b40693d1d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
https://invent.kde.org/utilities/ark/-/commit/785640b090b51e0067dbfc6c7944a478429204a2

From 785640b090b51e0067dbfc6c7944a478429204a2 Mon Sep 17 00:00:00 2001
From: Elvis Angelaccio <elvis.angelaccio@kde.org>
Date: Sat, 14 Oct 2023 17:34:10 +0200
Subject: [PATCH] Don't hardcode bzip2 mimetype in tests

Just take the name from QMimeDatabase, since it changes depending on
whether we are using a shared-mime-info >= 2.3
--- a/autotests/kerfuffle/adddialogtest.cpp
+++ b/autotests/kerfuffle/adddialogtest.cpp
@@ -37,7 +37,7 @@ void AddDialogTest::testBasicWidgets_data()
 
     QTest::newRow("tar") << QStringLiteral("application/x-tar") << false << -1 << -1;
     QTest::newRow("targzip") << QStringLiteral("application/x-compressed-tar") << true << 3 << 7;
-    QTest::newRow("tarbzip") << QStringLiteral("application/x-bzip-compressed-tar") << true << 3 << 7;
+    QTest::newRow("tarbzip") << QMimeDatabase().mimeTypeForFile(QStringLiteral("dummy.tar.bz2"), QMimeDatabase::MatchExtension).name() << true << 3 << 7;
     QTest::newRow("tarZ") << QStringLiteral("application/x-tarz") << false << -1 << -1;
     QTest::newRow("tarxz") << QStringLiteral("application/x-xz-compressed-tar") << true << 3 << 7;
     QTest::newRow("tarlzma") << QStringLiteral("application/x-lzma-compressed-tar") << true << 3 << 7;
--- a/autotests/kerfuffle/createdialogtest.cpp
+++ b/autotests/kerfuffle/createdialogtest.cpp
@@ -38,7 +38,7 @@ void CreateDialogTest::testBasicWidgets_data()
 
     QTest::newRow("tar") << QStringLiteral("application/x-tar");
     QTest::newRow("targzip") << QStringLiteral("application/x-compressed-tar");
-    QTest::newRow("tarbzip") << QStringLiteral("application/x-bzip-compressed-tar");
+    QTest::newRow("tarbzip") << QMimeDatabase().mimeTypeForFile(QStringLiteral("dummy.tar.bz2"), QMimeDatabase::MatchExtension).name();
     QTest::newRow("tarZ") << QStringLiteral("application/x-tarz");
     QTest::newRow("tarxz") << QStringLiteral("application/x-xz-compressed-tar");
     QTest::newRow("tarlzma") << QStringLiteral("application/x-lzma-compressed-tar");
--- a/autotests/kerfuffle/mimetypetest.cpp
+++ b/autotests/kerfuffle/mimetypetest.cpp
@@ -30,7 +30,7 @@ void MimeTypeTest::testMimeTypeDetection_data()
     QTest::addColumn<QString>("expectedMimeType");
 
     const QString compressedGzipTarMime = QStringLiteral("application/x-compressed-tar");
-    const QString compressedBzip2TarMime = QStringLiteral("application/x-bzip-compressed-tar");
+    const QString compressedBzip2TarMime = QMimeDatabase().mimeTypeForFile(QStringLiteral("dummy.tar.bz2"), QMimeDatabase::MatchExtension).name();
     const QString compressedXzTarMime = QStringLiteral("application/x-xz-compressed-tar");
     const QString compressedLzmaTarMime = QStringLiteral("application/x-lzma-compressed-tar");
     const QString compressedZTarMime = QStringLiteral("application/x-tarz");
-- 
GitLab