diff options
author | Benoit Foucher <benoit@zeroc.com> | 2017-01-18 19:16:02 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2017-01-18 19:16:02 +0100 |
commit | 4baf696c7156c9f300a33d9041bd677c574b6e14 (patch) | |
tree | 15d736254302f6b01260134a97f3bdfc04ff9738 /cpp/test/Ice/binding/Server.cpp | |
parent | Fixed bug introduced by previous commit (diff) | |
download | ice-4baf696c7156c9f300a33d9041bd677c574b6e14.tar.bz2 ice-4baf696c7156c9f300a33d9041bd677c574b6e14.tar.xz ice-4baf696c7156c9f300a33d9041bd677c574b6e14.zip |
Fixed ICE-2802 - no longer halt when running out of FDs
Diffstat (limited to 'cpp/test/Ice/binding/Server.cpp')
-rw-r--r-- | cpp/test/Ice/binding/Server.cpp | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/cpp/test/Ice/binding/Server.cpp b/cpp/test/Ice/binding/Server.cpp index a7fae8974a7..ad15c53ff8d 100644 --- a/cpp/test/Ice/binding/Server.cpp +++ b/cpp/test/Ice/binding/Server.cpp @@ -15,6 +15,49 @@ DEFINE_TEST("server") using namespace std; +namespace +{ + +// +// A no-op Logger, used when testing the Logger Admin +// + +class NullLogger : public Ice::Logger +#ifdef ICE_CPP11_MAPPING + , public std::enable_shared_from_this<NullLogger> +#endif +{ +public: + + virtual void print(const string&) + { + } + + virtual void trace(const string&, const string&) + { + } + + virtual void warning(const string&) + { + } + + virtual void error(const string&) + { + } + + virtual string getPrefix() + { + return "NullLogger"; + } + + virtual Ice::LoggerPtr cloneWithPrefix(const string&) + { + return ICE_SHARED_FROM_THIS; + } +}; + +} + int run(int, char**, const Ice::CommunicatorPtr& communicator) { @@ -42,6 +85,8 @@ main(int argc, char* argv[]) try { Ice::InitializationData initData = getTestInitData(argc, argv); + initData.properties->setProperty("Ice.Warn.Connections", "0"); + initData.logger = new NullLogger(); Ice::CommunicatorHolder ich = Ice::initialize(argc, argv, initData); return run(argc, argv, ich.communicator()); } |