Browse Source

[3668] Further changes after second review.

- Pass io_service to D2Process as a const reference
- Fix issues in memfile unittest
Marcin Siodelski 10 years ago
parent
commit
9fa33438f7

+ 1 - 1
src/bin/d2/d2_process.cc

@@ -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) {
 

+ 1 - 1
src/bin/d2/d2_process.h

@@ -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.

+ 4 - 4
src/lib/dhcpsrv/tests/memfile_lease_mgr_unittest.cc

@@ -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());
 
 }