Commit 9fa33438 authored by Marcin Siodelski's avatar Marcin Siodelski
Browse files

[3668] Further changes after second review.

- Pass io_service to D2Process as a const reference
- Fix issues in memfile unittest
parent 6f38f81f
......@@ -26,7 +26,7 @@ namespace d2 {
// be configurable.
const unsigned int D2Process::QUEUE_RESTART_PERCENT = 80;
D2Process::D2Process(const char* name, asiolink::IOServicePtr io_service)
D2Process::D2Process(const char* name, const asiolink::IOServicePtr& io_service)
: DProcessBase(name, io_service, DCfgMgrBasePtr(new D2CfgMgr())),
reconf_queue_flag_(false), shutdown_type_(SD_NORMAL) {
......
......@@ -66,7 +66,7 @@ public:
/// asynchronous event handling.
///
/// @throw DProcessBaseError is io_service is NULL.
D2Process(const char* name, asiolink::IOServicePtr io_service);
D2Process(const char* name, const asiolink::IOServicePtr& io_service);
/// @brief Called after instantiation to perform initialization unique to
/// D2.
......
......@@ -335,7 +335,7 @@ TEST_F(MemfileLeaseMgrTest, lfcTimerDisabled) {
// at which the IOService must be executed to run the handlers
// for the installed timers.
TEST_F(MemfileLeaseMgrTest, getIOServiceExecInterval) {
LeaseMgr::ParameterMap pmap;
LeaseMgr::ParameterMap pmap;
pmap["type"] = "memfile";
pmap["universe"] = "4";
pmap["name"] = getLeaseFilePath("leasefile4_0.csv");
......@@ -345,14 +345,14 @@ TEST_F(MemfileLeaseMgrTest, getIOServiceExecInterval) {
EXPECT_EQ(0, lease_mgr->getIOServiceExecInterval());
// lfc-interval = 10
pmap["lfc-interval"] = 10;
pmap["lfc-interval"] = "10";
lease_mgr.reset(new LFCMemfileLeaseMgr(pmap));
EXPECT_EQ(10, lease_mgr->getIOServiceExecInterval());
// lfc-interval = 20
pmap["lfc-interval"] = 20;
pmap["lfc-interval"] = "20";
lease_mgr.reset(new LFCMemfileLeaseMgr(pmap));
EXPECT_EQ(10, lease_mgr->getIOServiceExecInterval());
EXPECT_EQ(20, lease_mgr->getIOServiceExecInterval());
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment