diff options
author | Vincent Richard <[email protected]> | 2011-06-25 17:07:53 +0000 |
---|---|---|
committer | Vincent Richard <[email protected]> | 2011-06-25 17:07:53 +0000 |
commit | a55c574436973c354d731fffa81afabac98c1cfd (patch) | |
tree | 5f75eb67f009dc34b88a71f8701c5b26b836f0b9 /tests/parser/bodyPartTest.cpp | |
parent | Added missing libs in pkg-config file. (diff) | |
download | vmime-a55c574436973c354d731fffa81afabac98c1cfd.tar.gz vmime-a55c574436973c354d731fffa81afabac98c1cfd.zip |
Fixed parsing of empty body parts (thanks to John van der Kamp, from Zarafa).
Diffstat (limited to 'tests/parser/bodyPartTest.cpp')
-rw-r--r-- | tests/parser/bodyPartTest.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/parser/bodyPartTest.cpp b/tests/parser/bodyPartTest.cpp index b129913d..075b8f9a 100644 --- a/tests/parser/bodyPartTest.cpp +++ b/tests/parser/bodyPartTest.cpp @@ -36,6 +36,7 @@ VMIME_TEST_SUITE_BEGIN VMIME_TEST(testParseMissingLastBoundary) VMIME_TEST(testPrologEpilog) VMIME_TEST(testPrologEncoding) + VMIME_TEST(testSuccessiveBoundaries) VMIME_TEST_LIST_END @@ -181,5 +182,23 @@ VMIME_TEST_SUITE_BEGIN VASSERT_EQ("epilog", "Epilog text", msg->getBody()->getEpilogText()); } + void testSuccessiveBoundaries() + { + vmime::string str = + "Content-Type: multipart/mixed; boundary=\"MY-BOUNDARY\"" + "\r\n\r\n" + "--MY-BOUNDARY\r\nHEADER1\r\n\r\nBODY1\r\n" + "--MY-BOUNDARY\r\n" + "--MY-BOUNDARY--\r\n"; + + vmime::bodyPart p; + p.parse(str); + + VASSERT_EQ("count", 2, p.getBody()->getPartCount()); + + VASSERT_EQ("part1-body", "BODY1", extractContents(p.getBody()->getPartAt(0)->getBody()->getContents())); + VASSERT_EQ("part2-body", "", extractContents(p.getBody()->getPartAt(1)->getBody()->getContents())); + } + VMIME_TEST_SUITE_END |