aboutsummaryrefslogtreecommitdiffstats
path: root/tests/parser/mailboxTest.cpp
diff options
context:
space:
mode:
authorVincent Richard <[email protected]>2011-06-19 18:49:55 +0000
committerVincent Richard <[email protected]>2011-06-19 18:49:55 +0000
commit4f9dc93200616f11db6935f439c47252de5674d3 (patch)
treed09b8ca4a00b55166d99125431b0884a5d140b7c /tests/parser/mailboxTest.cpp
parentFixed messageBuilder to accept an empty mailbox group in 'To:' field, to allo... (diff)
downloadvmime-4f9dc93200616f11db6935f439c47252de5674d3.tar.gz
vmime-4f9dc93200616f11db6935f439c47252de5674d3.zip
Added support for mailboxes that specify an (encoded) full name with an empty email address, set by a <> marker (Zarafa).
Diffstat (limited to 'tests/parser/mailboxTest.cpp')
-rw-r--r--tests/parser/mailboxTest.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/parser/mailboxTest.cpp b/tests/parser/mailboxTest.cpp
index 8411daa7..9ebadca6 100644
--- a/tests/parser/mailboxTest.cpp
+++ b/tests/parser/mailboxTest.cpp
@@ -32,6 +32,7 @@ VMIME_TEST_SUITE_BEGIN
VMIME_TEST_LIST_BEGIN
VMIME_TEST(testParse)
+ VMIME_TEST(testEmptyEmailAddress)
VMIME_TEST_LIST_END
@@ -113,5 +114,19 @@ VMIME_TEST_SUITE_BEGIN
}
}
+ void testEmptyEmailAddress()
+ {
+ vmime::addressList addrList;
+ addrList.parse("\"Full Name\" <>");
+
+ VASSERT_EQ("count", 1, addrList.getAddressCount());
+ VASSERT_EQ("!group", false, addrList.getAddressAt(0)->isGroup());
+
+ vmime::ref <vmime::mailbox> mbox = addrList.getAddressAt(0).dynamicCast <vmime::mailbox>();
+
+ VASSERT_EQ("name", "Full Name", mbox->getName());
+ VASSERT_EQ("email", "", mbox->getEmail());
+ }
+
VMIME_TEST_SUITE_END