Added test for SMTP connection error.
This commit is contained in:
parent
757f8a7dc7
commit
759a89fcfd
@ -32,6 +32,7 @@
|
|||||||
VMIME_TEST_SUITE_BEGIN(SMTPTransportTest)
|
VMIME_TEST_SUITE_BEGIN(SMTPTransportTest)
|
||||||
|
|
||||||
VMIME_TEST_LIST_BEGIN
|
VMIME_TEST_LIST_BEGIN
|
||||||
|
VMIME_TEST(testConnectToInvalidServer)
|
||||||
VMIME_TEST(testGreetingError)
|
VMIME_TEST(testGreetingError)
|
||||||
VMIME_TEST(testMAILandRCPT)
|
VMIME_TEST(testMAILandRCPT)
|
||||||
VMIME_TEST(testChunking)
|
VMIME_TEST(testChunking)
|
||||||
@ -40,6 +41,17 @@ VMIME_TEST_SUITE_BEGIN(SMTPTransportTest)
|
|||||||
VMIME_TEST_LIST_END
|
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()
|
void testGreetingError()
|
||||||
{
|
{
|
||||||
vmime::ref <vmime::net::session> session =
|
vmime::ref <vmime::net::session> session =
|
||||||
|
Loading…
Reference in New Issue
Block a user