From 1592cccb6102ba3c28dbcb2387741c692164631e Mon Sep 17 00:00:00 2001 From: Vincent Richard Date: Thu, 14 Dec 2017 21:39:29 +0100 Subject: Fixed #186: use SMTPUTF8 only when needed. --- tests/testUtils.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'tests/testUtils.cpp') 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 +#include + + +// 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); } -- cgit v1.2.3