aboutsummaryrefslogtreecommitdiffstats
path: root/tests/testUtils.cpp
diff options
context:
space:
mode:
authorVincent Richard <[email protected]>2012-12-11 21:02:47 +0000
committerVincent Richard <[email protected]>2012-12-11 21:02:47 +0000
commit7fdcc31ab38dc623303edd6c7ddef5ffc17ef86a (patch)
tree16e1c600410c0f103f6988f94695067a6aa712cf /tests/testUtils.cpp
parentFixed wrong class name (copy/paste is BAD ;-) ). (diff)
downloadvmime-7fdcc31ab38dc623303edd6c7ddef5ffc17ef86a.tar.gz
vmime-7fdcc31ab38dc623303edd6c7ddef5ffc17ef86a.zip
Fixed compilation issues in unit tests.
Diffstat (limited to 'tests/testUtils.cpp')
-rw-r--r--tests/testUtils.cpp30
1 files changed, 27 insertions, 3 deletions
diff --git a/tests/testUtils.cpp b/tests/testUtils.cpp
index 36455cff..8b16c4e8 100644
--- a/tests/testUtils.cpp
+++ b/tests/testUtils.cpp
@@ -57,6 +57,24 @@ testSocket::size_type testSocket::getBlockSize() const
}
+unsigned int testSocket::getStatus() const
+{
+ return 0;
+}
+
+
+const vmime::string testSocket::getPeerName() const
+{
+ return "test.vmime.org";
+}
+
+
+const vmime::string testSocket::getPeerAddress() const
+{
+ return "127.0.0.1";
+}
+
+
void testSocket::receive(vmime::string& buffer)
{
buffer = m_inBuffer;
@@ -72,9 +90,9 @@ void testSocket::send(const vmime::string& buffer)
}
-int testSocket::receiveRaw(char* buffer, const int count)
+testSocket::size_type testSocket::receiveRaw(char* buffer, const size_type count)
{
- const int n = std::min(count, static_cast <int>(m_inBuffer.size()));
+ const size_type n = std::min(count, static_cast <size_type>(m_inBuffer.size()));
std::copy(m_inBuffer.begin(), m_inBuffer.begin() + n, buffer);
m_inBuffer.erase(m_inBuffer.begin(), m_inBuffer.begin() + n);
@@ -83,12 +101,18 @@ int testSocket::receiveRaw(char* buffer, const int count)
}
-void testSocket::sendRaw(const char* buffer, const int count)
+void testSocket::sendRaw(const char* buffer, const size_type count)
{
send(vmime::string(buffer, count));
}
+testSocket::size_type testSocket::sendRawNonBlocking(const char* buffer, const size_type count)
+{
+ sendRaw(buffer, count);
+}
+
+
void testSocket::localSend(const vmime::string& buffer)
{
m_inBuffer += buffer;