From: Tomek Mrugalski Date: Sat, 22 Apr 2017 09:18:42 +0000 (+0200) Subject: [5208a] setTestHostDataSource() added. X-Git-Tag: trac5212_base~10^2~8 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6702a3631fb22ddd35b71e5aee509ddf1f924486;p=thirdparty%2Fkea.git [5208a] setTestHostDataSource() added. --- diff --git a/src/lib/dhcpsrv/host_mgr.h b/src/lib/dhcpsrv/host_mgr.h index e00c45147d..7da6aba471 100644 --- a/src/lib/dhcpsrv/host_mgr.h +++ b/src/lib/dhcpsrv/host_mgr.h @@ -269,6 +269,22 @@ public: return (alternate_source_); } + /// @brief Sets the alternate host data source. + /// + /// Note: This should be used only for testing. Do not use + /// in production. Normal control flow assumes that + /// HostMgr::create(...) is called and it instnatiates + /// appropriate host data source. However, some tests + /// (e.g. host_cmds) implement their own very simple + /// data source. It's not production ready by any means, + /// so it does not belong in host_data_source_factory.cc. + /// The testing nature of this method is reflected in its name. + /// + /// @param source new source to be set (may be NULL) + void setTestHostDataSource(const HostDataSourcePtr& source) { + alternate_source_ = source; + } + private: /// @brief Private default constructor.