xfrin_session_(NULL),
counters_(),
keyring_(NULL),
+ datasrc_clients_mgr_(io_service_),
ddns_base_forwarder_(ddns_forwarder),
ddns_forwarder_(NULL),
xfrout_connected_(false),
#include <datasrc/client_list.h>
#include <datasrc/memory/zone_writer.h>
+#include <asiolink/io_service.h>
+
#include <auth/auth_log.h>
#include <auth/datasrc_config.h>
///
/// \throw std::bad_alloc internal memory allocation failure.
/// \throw isc::Unexpected general unexpected system errors.
- DataSrcClientsMgrBase() :
+ DataSrcClientsMgrBase(asiolink::IOService&) :
clients_map_(new ClientListsMap),
builder_(&command_queue_, &callback_queue_, &cond_, &queue_mutex_,
&clients_map_, &map_mutex_, -1 /* TEMPORARY */),
TEST(DataSrcClientsMgrTest, realThread) {
// Using the non-test definition with a real thread. Just checking
// no disruption happens.
- DataSrcClientsMgr mgr;
+ isc::asiolink::IOService service;
+ DataSrcClientsMgr mgr(service);
}
} // unnamed namespace
template<>
void
-TestDataSrcClientsMgr::cleanup() {
+TestDataSrcClientsMgrBase::cleanup() {
using namespace datasrc_clientmgr_internal;
// Make copy of some of the manager's member variables and reset the
// corresponding pointers. The currently pointed objects are in the
template<>
void
-TestDataSrcClientsMgr::reconfigureHook() {
+TestDataSrcClientsMgrBase::reconfigureHook() {
using namespace datasrc_clientmgr_internal;
// Simply replace the local map, ignoring bogus config value.
#include <auth/datasrc_clients_mgr.h>
#include <datasrc/datasrc_config.h>
+#include <asiolink/io_service.h>
+
#include <boost/function.hpp>
#include <list>
datasrc_clientmgr_internal::TestThread,
datasrc_clientmgr_internal::FakeDataSrcClientsBuilder,
datasrc_clientmgr_internal::TestMutex,
- datasrc_clientmgr_internal::TestCondVar> TestDataSrcClientsMgr;
+ datasrc_clientmgr_internal::TestCondVar> TestDataSrcClientsMgrBase;
// A specialization of manager's "cleanup" called at the end of the
// destructor. We use this to record the final values of some of the class
// member variables.
template<>
void
-TestDataSrcClientsMgr::cleanup();
+TestDataSrcClientsMgrBase::cleanup();
template<>
void
-TestDataSrcClientsMgr::reconfigureHook();
+TestDataSrcClientsMgrBase::reconfigureHook();
+
+// A (hackish) trick how to not require the IOService to be passed from the
+// tests. We can't create the io service as a member, because it would
+// get initialized too late.
+class TestDataSrcClientsMgr :
+ public asiolink::IOService,
+ public TestDataSrcClientsMgrBase {
+public:
+ TestDataSrcClientsMgr() :
+ TestDataSrcClientsMgrBase(*static_cast<asiolink::IOService*>(this))
+ {}
+};
} // namespace auth
} // namespace isc