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.
wilder-portage
Friedrich W. H. Kossebau 5 years ago
parent e16987a264
commit fb0184d655
  1. 4
      src/filter/autotests/filteractionaddheadertest.cpp
  2. 5
      src/filter/autotests/filteractionremoveheadertest.cpp
  3. 5
      src/filter/autotests/filteractionreplytotest.cpp
  4. 4
      src/filter/autotests/filteractionrewriteheadertest.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";

@ -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";

@ -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";

@ -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";

Loading…
Cancel
Save