aboutsummaryrefslogtreecommitdiffstats
path: root/tests/parser/bodyPartTest.cpp
diff options
context:
space:
mode:
authorVincent Richard <[email protected]>2012-04-05 20:10:54 +0000
committerVincent Richard <[email protected]>2012-04-05 20:10:54 +0000
commit6f03b1e380e002b6d6041e19514ef9d4c7181df6 (patch)
treed5075455a5bbae7a3fb7dc9e27c0f771ea01faf3 /tests/parser/bodyPartTest.cpp
parentUpdated README. (diff)
downloadvmime-6f03b1e380e002b6d6041e19514ef9d4c7181df6.tar.gz
vmime-6f03b1e380e002b6d6041e19514ef9d4c7181df6.zip
Added test: Ensure '7bit' encoding is used when body is 7-bit only.
Diffstat (limited to 'tests/parser/bodyPartTest.cpp')
-rw-r--r--tests/parser/bodyPartTest.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/parser/bodyPartTest.cpp b/tests/parser/bodyPartTest.cpp
index 075b8f9a..e1d47a36 100644
--- a/tests/parser/bodyPartTest.cpp
+++ b/tests/parser/bodyPartTest.cpp
@@ -37,6 +37,7 @@ VMIME_TEST_SUITE_BEGIN
VMIME_TEST(testPrologEpilog)
VMIME_TEST(testPrologEncoding)
VMIME_TEST(testSuccessiveBoundaries)
+ VMIME_TEST(testGenerate7bit)
VMIME_TEST_LIST_END
@@ -200,5 +201,18 @@ VMIME_TEST_SUITE_BEGIN
VASSERT_EQ("part2-body", "", extractContents(p.getBody()->getPartAt(1)->getBody()->getContents()));
}
+ /** Ensure '7bit' encoding is used when body is 7-bit only. */
+ void testGenerate7bit()
+ {
+ vmime::ref <vmime::plainTextPart> p1 = vmime::create <vmime::plainTextPart>();
+ p1->setText(vmime::create <vmime::stringContentHandler>("Part1 is US-ASCII only."));
+
+ vmime::ref <vmime::message> msg = vmime::create <vmime::message>();
+ p1->generateIn(msg, msg);
+
+ vmime::ref <vmime::header> header1 = msg->getBody()->getPartAt(0)->getHeader();
+ VASSERT_EQ("1", "7bit", header1->ContentTransferEncoding()->getValue()->generate());
+ }
+
VMIME_TEST_SUITE_END