diff options
author | Vincent Richard <[email protected]> | 2017-12-14 20:39:29 +0000 |
---|---|---|
committer | Vincent Richard <[email protected]> | 2017-12-14 20:39:29 +0000 |
commit | 1592cccb6102ba3c28dbcb2387741c692164631e (patch) | |
tree | 3273232b5a704916f0fcca2b85bab98f0ca1ee7e /tests/testUtils.cpp | |
parent | Merge pull request #182 from miachm/master (diff) | |
download | vmime-1592cccb6102ba3c28dbcb2387741c692164631e.tar.gz vmime-1592cccb6102ba3c28dbcb2387741c692164631e.zip |
Fixed #186: use SMTPUTF8 only when needed.
Diffstat (limited to 'tests/testUtils.cpp')
-rw-r--r-- | tests/testUtils.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/testUtils.cpp b/tests/testUtils.cpp index 0eb2bfd4..1e8e0c99 100644 --- a/tests/testUtils.cpp +++ b/tests/testUtils.cpp @@ -26,6 +26,11 @@ #include "vmime/utility/stringUtils.hpp" #include <cstring> +#include <iostream> + + +// Enable to output socket send/receive on standard output +#define DEBUG_SOCKET_IN_OUT 0 @@ -156,6 +161,11 @@ vmime::size_t testSocket::sendRawNonBlocking(const vmime::byte_t* buffer, const void testSocket::localSend(const vmime::string& buffer) { m_inBuffer += buffer; + +#if DEBUG_SOCKET_IN_OUT + std::cout << "> " << vmime::utility::stringUtils::trim(buffer) << std::endl; +#endif // DEBUG_SOCKET_IN_OUT + } @@ -232,6 +242,10 @@ void lineBasedTestSocket::onDataReceived() if (!line.empty() && line[line.length() - 1] == '\r') line.erase(line.end() - 1, line.end()); +#if DEBUG_SOCKET_IN_OUT + std::cout << "< " << vmime::utility::stringUtils::trim(line) << std::endl; +#endif // DEBUG_SOCKET_IN_OUT + m_lines.push_back(line); m_buffer.erase(m_buffer.begin(), m_buffer.begin() + eol + 1); } |