From 4b9289cfb260f4bcecaf23a810584ef6ef8e8501 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Wed, 30 Mar 2011 22:33:41 +0000 Subject: Ok, string stuff is working much, much better, a load of new unit tests have been added, and I deleted a whole slew of stupid old tests that I don't need. --- src/tests/itoserver.cpp | 80 ------------------------------------------------- 1 file changed, 80 deletions(-) delete mode 100644 src/tests/itoserver.cpp (limited to 'src/tests/itoserver.cpp') diff --git a/src/tests/itoserver.cpp b/src/tests/itoserver.cpp deleted file mode 100644 index 48ef527..0000000 --- a/src/tests/itoserver.cpp +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (C) 2007-2011 Xagasoft, All rights reserved. - * - * This file is part of the libbu++ library and is released under the - * terms of the license contained in the file LICENSE. - */ - -#include "bu/itoserver.h" -#include "bu/protocol.h" -#include "bu/client.h" - -#define BU_TRACE -#include "bu/trace.h" - -class ProtocolEcho : public Bu::Protocol -{ -public: - ProtocolEcho() - { - TRACE(); - } - virtual ~ProtocolEcho() - { - TRACE(); - } - - virtual void onNewConnection( Bu::Client * ) - { - TRACE(); - // Huh... - } - - virtual void onNewData( Bu::Client *pClient ) - { - TRACE(); - char buf[1024]; - while( pClient->hasInput() ) - { - int iAmnt = pClient->read( buf, 1024 ); - pClient->write( buf, iAmnt ); - } - } -}; - -class TestServer : public Bu::ItoServer -{ -public: - TestServer() - { - TRACE(); - } - virtual ~TestServer() - { - TRACE(); - } - - virtual void onNewConnection( Bu::Client *pClient, int ) - { - TRACE(); - pClient->setProtocol( new ProtocolEcho() ); - } - - virtual void onClosedConnection( Bu::Client *pClient ) - { - TRACE(); - delete pClient->getProtocol(); - } -}; - -int main() -{ - TRACE(); - - TestServer ts; - - ts.addPort( 5555 ); - ts.start(); - ts.join(); -} - -- cgit v1.2.3