mirror of
https://github.com/pocoproject/poco.git
synced 2024-12-16 19:54:38 +01:00
Add test case for MessageHeader decodeWord
This commit is contained in:
parent
f94d20492a
commit
8c98e4303c
@ -362,6 +362,23 @@ void MessageHeaderTest::testFieldLimit()
|
||||
}
|
||||
|
||||
|
||||
void MessageHeaderTest::testDecodeWord()
|
||||
{
|
||||
std::string coded("this is pure ASCII");
|
||||
std::string decoded = MessageHeader::decodeWord(coded, "ISO-8859-1");
|
||||
assert(decoded == coded);
|
||||
|
||||
coded = "(=?ISO-8859-1?Q?a?= =?ISO-8859-1?Q?b?=)";
|
||||
decoded = MessageHeader::decodeWord(coded, "ISO-8859-1");
|
||||
assert(decoded == "(a b)");
|
||||
|
||||
coded = "Hello =?UTF-8?B?RnJhbmNpcw==?=, good bye";
|
||||
decoded = MessageHeader::decodeWord(coded, "ISO-8859-1");
|
||||
assert(decoded == "Hello Francis, good bye");
|
||||
}
|
||||
|
||||
|
||||
|
||||
void MessageHeaderTest::setUp()
|
||||
{
|
||||
}
|
||||
@ -392,6 +409,7 @@ CppUnit::Test* MessageHeaderTest::suite()
|
||||
CppUnit_addTest(pSuite, MessageHeaderTest, testSplitElements);
|
||||
CppUnit_addTest(pSuite, MessageHeaderTest, testSplitParameters);
|
||||
CppUnit_addTest(pSuite, MessageHeaderTest, testFieldLimit);
|
||||
|
||||
CppUnit_addTest(pSuite, MessageHeaderTest, testDecodeWord);
|
||||
|
||||
return pSuite;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user