ping: Tests for Ping and PingServer
This commit includes minor refactoring in Ping and PingServer to support unit testing
refs #2796
Change-Id: Id0172486aa07e129a90091d72594fbccbb5dbc06
diff --git a/tools/ping/server/ping-server.cpp b/tools/ping/server/ping-server.cpp
index f919113..799fa8d 100644
--- a/tools/ping/server/ping-server.cpp
+++ b/tools/ping/server/ping-server.cpp
@@ -40,14 +40,20 @@
void
PingServer::run()
{
+ start();
+
+ m_face.getIoService().run();
+}
+
+void
+PingServer::start()
+{
m_name.append("ping");
m_face.setInterestFilter(m_name,
bind(&PingServer::onInterest,
this, _2),
bind(&PingServer::onRegisterFailed,
this, _2));
-
- m_face.processEvents();
}
int