diff options
author | Vincent Richard <[email protected]> | 2013-08-16 09:41:55 +0000 |
---|---|---|
committer | Vincent Richard <[email protected]> | 2013-08-16 09:41:55 +0000 |
commit | 759a89fcfdbc4b3e5dde36a437ea27a1b0c60775 (patch) | |
tree | ec5a44a3022c2116c4055fe71f49763071f70e35 /tests | |
parent | Fixed segfault at POP3 connection error. (diff) | |
download | vmime-759a89fcfdbc4b3e5dde36a437ea27a1b0c60775.tar.gz vmime-759a89fcfdbc4b3e5dde36a437ea27a1b0c60775.zip |
Added test for SMTP connection error.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/net/smtp/SMTPTransportTest.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/net/smtp/SMTPTransportTest.cpp b/tests/net/smtp/SMTPTransportTest.cpp index 70aaa4fd..4fc899dd 100644 --- a/tests/net/smtp/SMTPTransportTest.cpp +++ b/tests/net/smtp/SMTPTransportTest.cpp @@ -32,6 +32,7 @@ VMIME_TEST_SUITE_BEGIN(SMTPTransportTest) VMIME_TEST_LIST_BEGIN + VMIME_TEST(testConnectToInvalidServer) VMIME_TEST(testGreetingError) VMIME_TEST(testMAILandRCPT) VMIME_TEST(testChunking) @@ -40,6 +41,17 @@ VMIME_TEST_SUITE_BEGIN(SMTPTransportTest) VMIME_TEST_LIST_END + void testConnectToInvalidServer() + { + vmime::ref <vmime::net::session> sess + = vmime::create <vmime::net::session>(); + + vmime::utility::url url("smtp://invalid-smtp-server"); + vmime::ref <vmime::net::transport> store = sess->getTransport(url); + + VASSERT_THROW("connect", store->connect(), vmime::exceptions::connection_error); + } + void testGreetingError() { vmime::ref <vmime::net::session> session = |