From fb0184d65524745adc11bf239dc6af60fd06d970 Mon Sep 17 00:00:00 2001 From: "Friedrich W. H. Kossebau" Date: Mon, 9 Aug 2021 14:45:26 +0200 Subject: [PATCH] filter tests: adapt to kmime enforcing explicit Content-Type KMime since 5.15.2 turns a not-set content type to explicitly set MIME type text/plain with charset us-ascii. So tests passing data through KMime have to adapt the expected output to the header having that data set. To make input & output more comparable for the human code reader the respective input gets the explicit type also set. --- src/filter/autotests/filteractionaddheadertest.cpp | 4 ++++ src/filter/autotests/filteractionremoveheadertest.cpp | 5 +++++ src/filter/autotests/filteractionreplytotest.cpp | 5 +++++ src/filter/autotests/filteractionrewriteheadertest.cpp | 4 ++++ 4 files changed, 18 insertions(+) diff --git a/src/filter/autotests/filteractionaddheadertest.cpp b/src/filter/autotests/filteractionaddheadertest.cpp index d372fa2..e282341 100644 --- a/src/filter/autotests/filteractionaddheadertest.cpp +++ b/src/filter/autotests/filteractionaddheadertest.cpp @@ -116,6 +116,7 @@ void FilterActionAddHeaderTest::shouldAddNewHeaderWhenNotExistingHeader() "Subject: test\n" "Date: Wed, 01 Apr 2015 09:33:01 +0200\n" "MIME-Version: 1.0\n" + "Content-Type: text/plain; charset=\"us-ascii\"\n" "\n" "test"; const QByteArray output = @@ -124,6 +125,7 @@ void FilterActionAddHeaderTest::shouldAddNewHeaderWhenNotExistingHeader() "Subject: test\n" "Date: Wed, 01 Apr 2015 09:33:01 +0200\n" "MIME-Version: 1.0\n" + "Content-Type: text/plain; charset=\"us-ascii\"\n" "testheader: foo\n" "\n" "test"; @@ -152,6 +154,7 @@ void FilterActionAddHeaderTest::shouldReplaceHeaderWhenExistingHeader() "Subject: test\n" "Date: Wed, 01 Apr 2015 09:33:01 +0200\n" "MIME-Version: 1.0\n" + "Content-Type: text/plain; charset=\"us-ascii\"\n" "testheader: bla\n" "\n" "test"; @@ -161,6 +164,7 @@ void FilterActionAddHeaderTest::shouldReplaceHeaderWhenExistingHeader() "Subject: test\n" "Date: Wed, 01 Apr 2015 09:33:01 +0200\n" "MIME-Version: 1.0\n" + "Content-Type: text/plain; charset=\"us-ascii\"\n" "testheader: foo\n" "\n" "test"; diff --git a/src/filter/autotests/filteractionremoveheadertest.cpp b/src/filter/autotests/filteractionremoveheadertest.cpp index 2a72ae9..9e7c039 100644 --- a/src/filter/autotests/filteractionremoveheadertest.cpp +++ b/src/filter/autotests/filteractionremoveheadertest.cpp @@ -64,6 +64,7 @@ void FilterActionRemoveHeaderTest::shouldRemoveHeader() "testheader: foo\n" "Date: Wed, 01 Apr 2015 09:33:01 +0200\n" "MIME-Version: 1.0\n" + "Content-Type: text/plain; charset=\"us-ascii\"\n" "\n" "test"; const QByteArray output = @@ -72,6 +73,7 @@ void FilterActionRemoveHeaderTest::shouldRemoveHeader() "Subject: test\n" "Date: Wed, 01 Apr 2015 09:33:01 +0200\n" "MIME-Version: 1.0\n" + "Content-Type: text/plain; charset=\"us-ascii\"\n" "\n" "test"; @@ -98,6 +100,7 @@ void FilterActionRemoveHeaderTest::shouldNotTryToRemoveHeaderWhenItDoesntExist() "testheader2: foo\n" "Date: Wed, 01 Apr 2015 09:33:01 +0200\n" "MIME-Version: 1.0\n" + "Content-Type: text/plain; charset=\"us-ascii\"\n" "\n" "test"; @@ -126,6 +129,7 @@ void FilterActionRemoveHeaderTest::shouldRemoveMultiHeader() "testheader: bla\n" "Date: Wed, 01 Apr 2015 09:33:01 +0200\n" "MIME-Version: 1.0\n" + "Content-Type: text/plain; charset=\"us-ascii\"\n" "\n" "test"; const QByteArray output = @@ -134,6 +138,7 @@ void FilterActionRemoveHeaderTest::shouldRemoveMultiHeader() "Subject: test\n" "Date: Wed, 01 Apr 2015 09:33:01 +0200\n" "MIME-Version: 1.0\n" + "Content-Type: text/plain; charset=\"us-ascii\"\n" "\n" "test"; diff --git a/src/filter/autotests/filteractionreplytotest.cpp b/src/filter/autotests/filteractionreplytotest.cpp index d608a0b..05773a5 100644 --- a/src/filter/autotests/filteractionreplytotest.cpp +++ b/src/filter/autotests/filteractionreplytotest.cpp @@ -40,6 +40,7 @@ void FilterActionReplyToTest::shouldHadReplyToHeader() "Subject: test\n" "Date: Wed, 01 Apr 2015 09:33:01 +0200\n" "MIME-Version: 1.0\n" + "Content-Type: text/plain; charset=\"us-ascii\"\n" "\n" "test"; const QByteArray output = @@ -48,6 +49,7 @@ void FilterActionReplyToTest::shouldHadReplyToHeader() "Subject: test\n" "Date: Wed, 01 Apr 2015 09:33:01 +0200\n" "MIME-Version: 1.0\n" + "Content-Type: text/plain; charset=\"us-ascii\"\n" "Reply-To: fooreply@kde.org\n" "\n" "test"; @@ -76,6 +78,7 @@ void FilterActionReplyToTest::shouldReplaceReplyToHeader() "Subject: test\n" "Date: Wed, 01 Apr 2015 09:33:01 +0200\n" "MIME-Version: 1.0\n" + "Content-Type: text/plain; charset=\"us-ascii\"\n" "Reply-To: oldfooreply@kde.org\n" "\n" "test"; @@ -85,6 +88,7 @@ void FilterActionReplyToTest::shouldReplaceReplyToHeader() "Subject: test\n" "Date: Wed, 01 Apr 2015 09:33:01 +0200\n" "MIME-Version: 1.0\n" + "Content-Type: text/plain; charset=\"us-ascii\"\n" "Reply-To: fooreply@kde.org\n" "\n" "test"; @@ -117,6 +121,7 @@ void FilterActionReplyToTest::shouldNotCreateReplyToWhenAddressIsEmpty() "Subject: test\n" "Date: Wed, 01 Apr 2015 09:33:01 +0200\n" "MIME-Version: 1.0\n" + "Content-Type: text/plain; charset=\"us-ascii\"\n" "Reply-To: oldfooreply@kde.org\n" "\n" "test"; diff --git a/src/filter/autotests/filteractionrewriteheadertest.cpp b/src/filter/autotests/filteractionrewriteheadertest.cpp index 4321a23..d7c076d 100644 --- a/src/filter/autotests/filteractionrewriteheadertest.cpp +++ b/src/filter/autotests/filteractionrewriteheadertest.cpp @@ -93,6 +93,7 @@ void FilterActionRewriteHeaderTest::shouldRewriteHeader() "testheader: foo\n" "Date: Wed, 01 Apr 2015 09:33:01 +0200\n" "MIME-Version: 1.0\n" + "Content-Type: text/plain; charset=\"us-ascii\"\n" "\n" "test"; const QByteArray output = @@ -101,6 +102,7 @@ void FilterActionRewriteHeaderTest::shouldRewriteHeader() "Subject: test\n" "Date: Wed, 01 Apr 2015 09:33:01 +0200\n" "MIME-Version: 1.0\n" + "Content-Type: text/plain; charset=\"us-ascii\"\n" "testheader: bla\n" "\n" "test"; @@ -127,6 +129,7 @@ void FilterActionRewriteHeaderTest::shouldNotRewriteHeaderWhenHeaderNotFound() "Subject: test\n" "Date: Wed, 01 Apr 2015 09:33:01 +0200\n" "MIME-Version: 1.0\n" + "Content-Type: text/plain; charset=\"us-ascii\"\n" "\n" "test"; @@ -152,6 +155,7 @@ void FilterActionRewriteHeaderTest::shouldNotRewriteHeaderWhenRegexpNotFound() "Subject: test\n" "Date: Wed, 01 Apr 2015 09:33:01 +0200\n" "MIME-Version: 1.0\n" + "Content-Type: text/plain; charset=\"us-ascii\"\n" "testheader: bla\n" "\n" "test";