Mercurial > thymian
comparison 3rdparty/vmime/tests/net/pop3/POP3TestUtils.hpp @ 0:a4671277546c tip
created the repository for the thymian project
| author | ferencd |
|---|---|
| date | Tue, 17 Aug 2021 11:19:54 +0200 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:a4671277546c |
|---|---|
| 1 // | |
| 2 // VMime library (http://www.vmime.org) | |
| 3 // Copyright (C) 2002-2013 Vincent Richard <vincent@vmime.org> | |
| 4 // | |
| 5 // This program is free software; you can redistribute it and/or | |
| 6 // modify it under the terms of the GNU General Public License as | |
| 7 // published by the Free Software Foundation; either version 3 of | |
| 8 // the License, or (at your option) any later version. | |
| 9 // | |
| 10 // This program is distributed in the hope that it will be useful, | |
| 11 // but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 // General Public License for more details. | |
| 14 // | |
| 15 // You should have received a copy of the GNU General Public License along | |
| 16 // with this program; if not, write to the Free Software Foundation, Inc., | |
| 17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | |
| 18 // | |
| 19 // Linking this library statically or dynamically with other modules is making | |
| 20 // a combined work based on this library. Thus, the terms and conditions of | |
| 21 // the GNU General Public License cover the whole combination. | |
| 22 // | |
| 23 | |
| 24 #include "vmime/net/pop3/POP3Connection.hpp" | |
| 25 #include "vmime/net/pop3/POP3Store.hpp" | |
| 26 | |
| 27 | |
| 28 class POP3TestStore : public vmime::net::pop3::POP3Store | |
| 29 { | |
| 30 public: | |
| 31 | |
| 32 POP3TestStore() | |
| 33 : POP3Store(vmime::make_shared <vmime::net::session>(), | |
| 34 vmime::shared_ptr <vmime::security::authenticator>()) | |
| 35 { | |
| 36 } | |
| 37 }; | |
| 38 | |
| 39 | |
| 40 class POP3ConnectionTest : public vmime::net::pop3::POP3Connection | |
| 41 { | |
| 42 public: | |
| 43 | |
| 44 POP3ConnectionTest(vmime::shared_ptr <vmime::net::socket> socket, | |
| 45 vmime::shared_ptr <vmime::net::timeoutHandler> timeoutHandler) | |
| 46 : POP3Connection(vmime::make_shared <POP3TestStore>(), | |
| 47 vmime::shared_ptr <vmime::security::authenticator>()), | |
| 48 m_socket(socket), m_timeoutHandler(timeoutHandler) | |
| 49 { | |
| 50 } | |
| 51 | |
| 52 vmime::shared_ptr <vmime::net::socket> getSocket() | |
| 53 { | |
| 54 return m_socket; | |
| 55 } | |
| 56 | |
| 57 vmime::shared_ptr <vmime::net::timeoutHandler> getTimeoutHandler() | |
| 58 { | |
| 59 return m_timeoutHandler; | |
| 60 } | |
| 61 | |
| 62 private: | |
| 63 | |
| 64 vmime::shared_ptr <vmime::net::socket> m_socket; | |
| 65 vmime::shared_ptr <vmime::net::timeoutHandler> m_timeoutHandler; | |
| 66 }; |
