X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Socket%2FSocketProtocol.test.hh;h=d03e6df92d1c24ae35177869b975ab7d11bf42ee;hb=3863d46dd898b7bc35ea8c6ccd8563b18762a6b6;hp=b698e7c617191a00498e5f266ef56a827508b4bf;hpb=85ab07d100a382467a42e19d741d403a7a96c951;p=senf.git diff --git a/Socket/SocketProtocol.test.hh b/Socket/SocketProtocol.test.hh index b698e7c..d03e6df 100644 --- a/Socket/SocketProtocol.test.hh +++ b/Socket/SocketProtocol.test.hh @@ -1,9 +1,9 @@ // $Id$ // // Copyright (C) 2006 -// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS) -// Kompetenzzentrum fuer Satelitenkommunikation (SatCom) -// Stefan Bund +// Fraunhofer Institute for Open Communication Systems (FOKUS) +// Competence Center NETwork research (NET), St. Augustin, GERMANY +// Stefan Bund // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -20,8 +20,8 @@ // Free Software Foundation, Inc., // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -#ifndef HH_SocketProtocol_test_ -#define HH_SocketProtocol_test_ 1 +#ifndef HH_SENF_Socket_SocketProtocol_test_ +#define HH_SENF_Socket_SocketProtocol_test_ 1 // Custom includes #include "SocketProtocol.hh" @@ -32,24 +32,31 @@ ///////////////////////////////hh.p//////////////////////////////////////// namespace senf { - namespace test { - class SomeProtocol - : public ConcreteSocketProtocol + class SomeSocketProtocol + : public ConcreteSocketProtocol { public: - ~SomeProtocol() {} + ~SomeSocketProtocol() {} - void init_client() const {} - void init_server() const {} + void init_client() const { fd(0); } + void init_server() const { fd(0); } - std::auto_ptr clone() const - { return std::auto_ptr(new SomeProtocol()); } unsigned available() const { return Policy::ReadPolicy::TEST_SIZE; } bool eof() const { return false; } + + virtual void close() { + closeCount(1); + } + + static unsigned closeCount(unsigned inc=0) { + static unsigned counter (0); + counter += inc; + return counter; + } }; }} @@ -68,4 +75,6 @@ namespace test { // c-file-style: "senf" // indent-tabs-mode: nil // ispell-local-dictionary: "american" +// compile-command: "scons -u test" +// comment-column: 40 // End: