diff options
author | Vincent Richard <[email protected]> | 2018-09-05 21:54:48 +0000 |
---|---|---|
committer | Vincent Richard <[email protected]> | 2018-09-05 21:54:48 +0000 |
commit | b55bdc9c0bb68236aa2de0a8eaec9f4c80cc2769 (patch) | |
tree | efa18d623d3bc67c41d643aae145c16aa8f1006d /tests/parser/bodyTest.cpp | |
parent | Merge pull request #198 from xguerin/master (diff) | |
download | vmime-b55bdc9c0bb68236aa2de0a8eaec9f4c80cc2769.tar.gz vmime-b55bdc9c0bb68236aa2de0a8eaec9f4c80cc2769.zip |
Code style and clarity.
Diffstat (limited to 'tests/parser/bodyTest.cpp')
-rw-r--r-- | tests/parser/bodyTest.cpp | 44 |
1 files changed, 29 insertions, 15 deletions
diff --git a/tests/parser/bodyTest.cpp b/tests/parser/bodyTest.cpp index 92a4575e..fa396af5 100644 --- a/tests/parser/bodyTest.cpp +++ b/tests/parser/bodyTest.cpp @@ -1,6 +1,6 @@ // // VMime library (http://www.vmime.org) -// Copyright (C) 2002-2013 Vincent Richard <[email protected]> +// Copyright (C) 2002 Vincent Richard <[email protected]> // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License as @@ -32,35 +32,49 @@ VMIME_TEST_SUITE_BEGIN(bodyTest) VMIME_TEST_LIST_END - void testGenerate_Text() - { + void testGenerate_Text() { + // RFC-2015: [Quoted-Printable encoding] A line break in a text body, // represented as a CRLF sequence in the text canonical form, must be // represented by a line break which is also a CRLF sequence, in the // Quoted-Printable encoding vmime::bodyPart p; - p.getBody()->setContents(vmime::make_shared <vmime::stringContentHandler> - ("Foo éé\r\né bar\r\nbaz"), vmime::mediaType("text", "plain"), - vmime::charset("utf-8"), vmime::encoding("quoted-printable")); + p.getBody()->setContents( + vmime::make_shared <vmime::stringContentHandler>( + "Foo éé\r\né bar\r\nbaz" + ), + vmime::mediaType("text", "plain"), + vmime::charset("utf-8"), + vmime::encoding("quoted-printable") + ); - VASSERT_EQ("generate", + VASSERT_EQ( + "generate", "Foo =C3=A9=C3=A9\r\n" "=C3=A9 bar\r\n" "baz", - p.getBody()->generate()); + p.getBody()->generate() + ); } - void testGenerate_NonText() - { + void testGenerate_NonText() { + vmime::bodyPart p; - p.getBody()->setContents(vmime::make_shared <vmime::stringContentHandler> - ("Binary\xfa\xfb\r\ndata\r\n\r\n\xfc"), vmime::mediaType("application", "octet-stream"), - vmime::charset("utf-8"), vmime::encoding("quoted-printable")); + p.getBody()->setContents( + vmime::make_shared <vmime::stringContentHandler>( + "Binary\xfa\xfb\r\ndata\r\n\r\n\xfc" + ), + vmime::mediaType("application", "octet-stream"), + vmime::charset("utf-8"), + vmime::encoding("quoted-printable") + ); - VASSERT_EQ("generate", + VASSERT_EQ( + "generate", "Binary=FA=FB=0D=0Adata=0D=0A=0D=0A=FC", - p.getBody()->generate()); + p.getBody()->generate() + ); } VMIME_TEST_SUITE_END |