X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Socket%2FSocketProtocol.test.hh;h=bdfb5f7cb2e90ea6f4dabdbe1842ec33c29959e5;hb=3cb0a2ff50b8f1111da34b696e64fb1b037cd683;hp=220864d961b88a9b4b78696d40c4cb8effe06b3c;hpb=f73fa16ed5abdce272ac77f8b8b9ef2b9922c266;p=senf.git diff --git a/Socket/SocketProtocol.test.hh b/Socket/SocketProtocol.test.hh index 220864d..bdfb5f7 100644 --- a/Socket/SocketProtocol.test.hh +++ b/Socket/SocketProtocol.test.hh @@ -1,8 +1,8 @@ // $Id$ // // Copyright (C) 2006 -// Fraunhofer Institute for Open Communication Systems (FOKUS) -// Competence Center NETwork research (NET), St. Augustin, GERMANY +// 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 @@ -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() const { + closeCount(1); + } + + static unsigned closeCount(unsigned inc=0) { + static unsigned counter (0); + counter += inc; + return counter; + } }; }}