aboutsummaryrefslogtreecommitdiffstats
path: root/tests/parser/textTest.cpp
diff options
context:
space:
mode:
authorVincent Richard <[email protected]>2015-01-14 18:35:28 +0000
committerVincent Richard <[email protected]>2015-01-14 18:35:28 +0000
commite7739c0efe80da9804464e0edfa8d7fe76d70148 (patch)
tree4f633a645ac094e494c7e0070a77e3ae6e8f801a /tests/parser/textTest.cpp
parentStop decoding when there are no more input bytes. (diff)
downloadvmime-e7739c0efe80da9804464e0edfa8d7fe76d70148.tar.gz
vmime-e7739c0efe80da9804464e0edfa8d7fe76d70148.zip
Fixed issue #98: support for wrongly padded B64 words.
Diffstat (limited to 'tests/parser/textTest.cpp')
-rw-r--r--tests/parser/textTest.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/parser/textTest.cpp b/tests/parser/textTest.cpp
index 58d5bff5..588dc194 100644
--- a/tests/parser/textTest.cpp
+++ b/tests/parser/textTest.cpp
@@ -59,6 +59,8 @@ VMIME_TEST_SUITE_BEGIN(textTest)
VMIME_TEST(testInternationalizedEmail_UTF8)
VMIME_TEST(testInternationalizedEmail_nonUTF8)
VMIME_TEST(testInternationalizedEmail_folding)
+
+ VMIME_TEST(testWronglyPaddedB64Words)
VMIME_TEST_LIST_END
@@ -595,5 +597,25 @@ VMIME_TEST_SUITE_BEGIN(textTest)
" encoded text", w2.generate(20));
}
+ void testWronglyPaddedB64Words()
+ {
+ vmime::text outText;
+
+ vmime::text::decodeAndUnfold("=?utf-8?B?5Lit5?=\n =?utf-8?B?paH?=", &outText);
+
+ VASSERT_EQ("1", "\xe4\xb8\xad\xe6\x96\x87",
+ outText.getConvertedText(vmime::charset("utf-8")));
+
+ vmime::text::decodeAndUnfold("=?utf-8?B?5Lit5p?=\n =?utf-8?B?aH?=", &outText);
+
+ VASSERT_EQ("2", "\xe4\xb8\xad\xe6\x96\x87",
+ outText.getConvertedText(vmime::charset("utf-8")));
+
+ vmime::text::decodeAndUnfold("=?utf-8?B?5Lit5pa?=\n =?utf-8?B?H?=", &outText);
+
+ VASSERT_EQ("3", "\xe4\xb8\xad\xe6\x96\x87",
+ outText.getConvertedText(vmime::charset("utf-8")));
+ }
+
VMIME_TEST_SUITE_END