summaryrefslogtreecommitdiff
path: root/test/basicserver/TestCommands.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/basicserver/TestCommands.cpp')
-rw-r--r--test/basicserver/TestCommands.cpp53
1 files changed, 53 insertions, 0 deletions
diff --git a/test/basicserver/TestCommands.cpp b/test/basicserver/TestCommands.cpp
index 657e79ea..e193458e 100644
--- a/test/basicserver/TestCommands.cpp
+++ b/test/basicserver/TestCommands.cpp
@@ -5,12 +5,17 @@
#include <syslog.h>
#endif
+<<<<<<< HEAD
#include "autogen_TestProtocolServer.h"
+=======
+#include "autogen_TestProtocol.h"
+>>>>>>> 0.12
#include "CollectInBufferStream.h"
#include "MemLeakFindOn.h"
+<<<<<<< HEAD
std::auto_ptr<ProtocolObject> TestProtocolServerHello::DoCommand(TestProtocolServer &rProtocol, TestContext &rContext)
{
if(mNumber32 != 41 || mNumber16 != 87 || mNumber8 != 11 || mText != "pingu")
@@ -33,6 +38,30 @@ std::auto_ptr<ProtocolObject> TestProtocolServerQuit::DoCommand(TestProtocolServ
std::auto_ptr<ProtocolObject> TestProtocolServerSimple::DoCommand(TestProtocolServer &rProtocol, TestContext &rContext)
{
return std::auto_ptr<ProtocolObject>(new TestProtocolServerSimpleReply(mValue+1));
+=======
+std::auto_ptr<TestProtocolMessage> TestProtocolHello::DoCommand(TestProtocolReplyable &rProtocol, TestContext &rContext) const
+{
+ if(mNumber32 != 41 || mNumber16 != 87 || mNumber8 != 11 || mText != "pingu")
+ {
+ return std::auto_ptr<TestProtocolMessage>(new TestProtocolError(0, 0));
+ }
+ return std::auto_ptr<TestProtocolMessage>(new TestProtocolHello(12,89,22,std::string("Hello world!")));
+}
+
+std::auto_ptr<TestProtocolMessage> TestProtocolLists::DoCommand(TestProtocolReplyable &rProtocol, TestContext &rContext) const
+{
+ return std::auto_ptr<TestProtocolMessage>(new TestProtocolListsReply(mLotsOfText.size()));
+}
+
+std::auto_ptr<TestProtocolMessage> TestProtocolQuit::DoCommand(TestProtocolReplyable &rProtocol, TestContext &rContext) const
+{
+ return std::auto_ptr<TestProtocolMessage>(new TestProtocolQuit);
+}
+
+std::auto_ptr<TestProtocolMessage> TestProtocolSimple::DoCommand(TestProtocolReplyable &rProtocol, TestContext &rContext) const
+{
+ return std::auto_ptr<TestProtocolMessage>(new TestProtocolSimpleReply(mValue+1));
+>>>>>>> 0.12
}
class UncertainBufferStream : public CollectInBufferStream
@@ -45,7 +74,11 @@ public:
}
};
+<<<<<<< HEAD
std::auto_ptr<ProtocolObject> TestProtocolServerGetStream::DoCommand(TestProtocolServer &rProtocol, TestContext &rContext)
+=======
+std::auto_ptr<TestProtocolMessage> TestProtocolGetStream::DoCommand(TestProtocolReplyable &rProtocol, TestContext &rContext) const
+>>>>>>> 0.12
{
// make a new stream object
CollectInBufferStream *pstream = mUncertainSize?(new UncertainBufferStream):(new CollectInBufferStream);
@@ -68,6 +101,7 @@ std::auto_ptr<ProtocolObject> TestProtocolServerGetStream::DoCommand(TestProtoco
// Get it to be sent
rProtocol.SendStreamAfterCommand(pstream);
+<<<<<<< HEAD
return std::auto_ptr<ProtocolObject>(new TestProtocolServerGetStream(mStartingValue, mUncertainSize));
}
@@ -76,6 +110,16 @@ std::auto_ptr<ProtocolObject> TestProtocolServerSendStream::DoCommand(TestProtoc
if(mValue != 0x73654353298ffLL)
{
return std::auto_ptr<ProtocolObject>(new TestProtocolServerError(0, 0));
+=======
+ return std::auto_ptr<TestProtocolMessage>(new TestProtocolGetStream(mStartingValue, mUncertainSize));
+}
+
+std::auto_ptr<TestProtocolMessage> TestProtocolSendStream::DoCommand(TestProtocolReplyable &rProtocol, TestContext &rContext) const
+{
+ if(mValue != 0x73654353298ffLL)
+ {
+ return std::auto_ptr<TestProtocolMessage>(new TestProtocolError(0, 0));
+>>>>>>> 0.12
}
// Get a stream
@@ -91,11 +135,20 @@ std::auto_ptr<ProtocolObject> TestProtocolServerSendStream::DoCommand(TestProtoc
}
// tell the caller how many bytes there were
+<<<<<<< HEAD
return std::auto_ptr<ProtocolObject>(new TestProtocolServerGetStream(bytes, uncertain));
}
std::auto_ptr<ProtocolObject> TestProtocolServerString::DoCommand(TestProtocolServer &rProtocol, TestContext &rContext)
{
return std::auto_ptr<ProtocolObject>(new TestProtocolServerString(mTest));
+=======
+ return std::auto_ptr<TestProtocolMessage>(new TestProtocolGetStream(bytes, uncertain));
+}
+
+std::auto_ptr<TestProtocolMessage> TestProtocolString::DoCommand(TestProtocolReplyable &rProtocol, TestContext &rContext) const
+{
+ return std::auto_ptr<TestProtocolMessage>(new TestProtocolString(mTest));
+>>>>>>> 0.12
}