diff options
| author | Vincent Richard <[email protected]> | 2013-11-21 21:16:57 +0000 |
|---|---|---|
| committer | Vincent Richard <[email protected]> | 2013-11-21 21:16:57 +0000 |
| commit | f9913fa28a27f23fde2d4956c62cbb2fb2bc2ee8 (patch) | |
| tree | 2bdc90e361a8f6e0a81164cf67afec9f78f9b959 /tests/net/imap | |
| parent | Per-protocol include files. (diff) | |
| download | vmime-f9913fa28a27f23fde2d4956c62cbb2fb2bc2ee8.tar.gz vmime-f9913fa28a27f23fde2d4956c62cbb2fb2bc2ee8.zip | |
Boost/C++11 shared pointers.
Diffstat (limited to 'tests/net/imap')
| -rw-r--r-- | tests/net/imap/IMAPParserTest.cpp | 13 | ||||
| -rw-r--r-- | tests/net/imap/IMAPTagTest.cpp | 16 |
2 files changed, 15 insertions, 14 deletions
diff --git a/tests/net/imap/IMAPParserTest.cpp b/tests/net/imap/IMAPParserTest.cpp index 93f6e6fd..30e8f574 100644 --- a/tests/net/imap/IMAPParserTest.cpp +++ b/tests/net/imap/IMAPParserTest.cpp @@ -37,18 +37,19 @@ VMIME_TEST_SUITE_BEGIN(IMAPParserTest) // For Apple iCloud IMAP server void testExtraSpaceInCapaResponse() { - vmime::ref <testSocket> socket = vmime::create <testSocket>(); - vmime::ref <vmime::net::timeoutHandler> toh = vmime::create <testTimeoutHandler>(); + vmime::shared_ptr <testSocket> socket = vmime::make_shared <testSocket>(); + vmime::shared_ptr <vmime::net::timeoutHandler> toh = vmime::make_shared <testTimeoutHandler>(); - vmime::ref <vmime::net::imap::IMAPTag> tag = - vmime::create <vmime::net::imap::IMAPTag>(); + vmime::shared_ptr <vmime::net::imap::IMAPTag> tag = + vmime::make_shared <vmime::net::imap::IMAPTag>(); socket->localSend( "* CAPABILITY IMAP4rev1 AUTH=ATOKEN AUTH=PLAIN \r\n" // extra space at end "a001 OK Capability completed.\r\n"); - vmime::ref <vmime::net::imap::IMAPParser> parser = - vmime::create <vmime::net::imap::IMAPParser>(tag, socket.dynamicCast <vmime::net::socket>(), toh); + vmime::shared_ptr <vmime::net::imap::IMAPParser> parser = + vmime::make_shared <vmime::net::imap::IMAPParser> + (tag, vmime::dynamicCast <vmime::net::socket>(socket), toh); parser->setStrict(false); VASSERT_NO_THROW("non-strict mode", parser->readResponse(/* literalHandler */ NULL)); diff --git a/tests/net/imap/IMAPTagTest.cpp b/tests/net/imap/IMAPTagTest.cpp index 26ed87c5..db04537a 100644 --- a/tests/net/imap/IMAPTagTest.cpp +++ b/tests/net/imap/IMAPTagTest.cpp @@ -38,16 +38,16 @@ VMIME_TEST_SUITE_BEGIN(imapTagTest) void testConstruct() { - vmime::ref <vmime::net::imap::IMAPTag> tag = - vmime::create <vmime::net::imap::IMAPTag>(); + vmime::shared_ptr <vmime::net::imap::IMAPTag> tag = + vmime::make_shared <vmime::net::imap::IMAPTag>(); VASSERT_EQ("init", "a001", static_cast <vmime::string>(*tag)); } void testIncrement() { - vmime::ref <vmime::net::imap::IMAPTag> tag = - vmime::create <vmime::net::imap::IMAPTag>(); + vmime::shared_ptr <vmime::net::imap::IMAPTag> tag = + vmime::make_shared <vmime::net::imap::IMAPTag>(); (*tag)++; VASSERT_EQ("init", "a002", static_cast <vmime::string>(*tag)); @@ -61,8 +61,8 @@ VMIME_TEST_SUITE_BEGIN(imapTagTest) void testReset() { - vmime::ref <vmime::net::imap::IMAPTag> tag = - vmime::create <vmime::net::imap::IMAPTag>(); + vmime::shared_ptr <vmime::net::imap::IMAPTag> tag = + vmime::make_shared <vmime::net::imap::IMAPTag>(); for (int i = tag->number() ; i < tag->maximumNumber() ; ++i) (*tag)++; @@ -76,8 +76,8 @@ VMIME_TEST_SUITE_BEGIN(imapTagTest) void testNumber() { - vmime::ref <vmime::net::imap::IMAPTag> tag = - vmime::create <vmime::net::imap::IMAPTag>(); + vmime::shared_ptr <vmime::net::imap::IMAPTag> tag = + vmime::make_shared <vmime::net::imap::IMAPTag>(); for (int i = 0 ; i < 41 ; ++i) (*tag)++; |
