|
|
@ -5,13 +5,10 @@
|
|
|
|
#include "Message.hpp"
|
|
|
|
#include "Message.hpp"
|
|
|
|
#include "Connection.hpp"
|
|
|
|
#include "Connection.hpp"
|
|
|
|
|
|
|
|
|
|
|
|
class TestMessage : public CxxTest::TestSuite
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class SimpleMessage : public Message
|
|
|
|
class SimpleMessage : public Message
|
|
|
|
{
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
|
|
SimpleMessage( void *msgParam = 0)
|
|
|
|
SimpleMessage( void *msgParam = 0)
|
|
|
|
: Message(msgParam)
|
|
|
|
: Message(msgParam)
|
|
|
@ -40,6 +37,8 @@ private:
|
|
|
|
|
|
|
|
|
|
|
|
if (m_connection != 0)
|
|
|
|
if (m_connection != 0)
|
|
|
|
m_connection->send(m_buffer.c_str(), m_buffer.length());
|
|
|
|
m_connection->send(m_buffer.c_str(), m_buffer.length());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
m_buffer.clear();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Message* clone()
|
|
|
|
Message* clone()
|
|
|
@ -54,7 +53,7 @@ private:
|
|
|
|
return m_buffer;
|
|
|
|
return m_buffer;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
protected:
|
|
|
|
|
|
|
|
|
|
|
|
size_t getExpectedLength()
|
|
|
|
size_t getExpectedLength()
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -62,8 +61,12 @@ private:
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}; // SimpleMessage
|
|
|
|
}; // SimpleMessage
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class TestMessage : public CxxTest::TestSuite
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
|
|
|
|
class DummyConnection : public Connection
|
|
|
|
class DummyConnection : public Connection
|
|
|
|
{
|
|
|
|
{
|
|
|
|