AC_CONFIG_FILES([src/hooks/dhcp/lease_cmds/Makefile])
AC_CONFIG_FILES([src/hooks/dhcp/lease_cmds/libloadtests/Makefile])
AC_CONFIG_FILES([src/hooks/dhcp/lease_cmds/tests/Makefile])
-AC_CONFIG_FILES([src/hooks/dhcp/mysql_lb/Makefile])
-AC_CONFIG_FILES([src/hooks/dhcp/mysql_lb/libloadtests/Makefile])
-AC_CONFIG_FILES([src/hooks/dhcp/mysql_lb/tests/Makefile])
-AC_CONFIG_FILES([src/hooks/dhcp/mysql_hb/Makefile])
-AC_CONFIG_FILES([src/hooks/dhcp/mysql_hb/libloadtests/Makefile])
-AC_CONFIG_FILES([src/hooks/dhcp/mysql_hb/tests/Makefile])
AC_CONFIG_FILES([src/hooks/dhcp/mysql_cb/Makefile])
AC_CONFIG_FILES([src/hooks/dhcp/mysql_cb/libloadtests/Makefile])
AC_CONFIG_FILES([src/hooks/dhcp/mysql_cb/tests/Makefile])
-AC_CONFIG_FILES([src/hooks/dhcp/pgsql_lb/Makefile])
-AC_CONFIG_FILES([src/hooks/dhcp/pgsql_lb/libloadtests/Makefile])
-AC_CONFIG_FILES([src/hooks/dhcp/pgsql_lb/tests/Makefile])
-AC_CONFIG_FILES([src/hooks/dhcp/pgsql_hb/Makefile])
-AC_CONFIG_FILES([src/hooks/dhcp/pgsql_hb/libloadtests/Makefile])
-AC_CONFIG_FILES([src/hooks/dhcp/pgsql_hb/tests/Makefile])
+AC_CONFIG_FILES([src/hooks/dhcp/mysql_hb/Makefile])
+AC_CONFIG_FILES([src/hooks/dhcp/mysql_hb/libloadtests/Makefile])
+AC_CONFIG_FILES([src/hooks/dhcp/mysql_hb/tests/Makefile])
+AC_CONFIG_FILES([src/hooks/dhcp/mysql_lb/Makefile])
+AC_CONFIG_FILES([src/hooks/dhcp/mysql_lb/libloadtests/Makefile])
+AC_CONFIG_FILES([src/hooks/dhcp/mysql_lb/tests/Makefile])
AC_CONFIG_FILES([src/hooks/dhcp/pgsql_cb/Makefile])
AC_CONFIG_FILES([src/hooks/dhcp/pgsql_cb/libloadtests/Makefile])
AC_CONFIG_FILES([src/hooks/dhcp/pgsql_cb/tests/Makefile])
+AC_CONFIG_FILES([src/hooks/dhcp/pgsql_hb/Makefile])
+AC_CONFIG_FILES([src/hooks/dhcp/pgsql_hb/libloadtests/Makefile])
+AC_CONFIG_FILES([src/hooks/dhcp/pgsql_hb/tests/Makefile])
+AC_CONFIG_FILES([src/hooks/dhcp/pgsql_lb/Makefile])
+AC_CONFIG_FILES([src/hooks/dhcp/pgsql_lb/libloadtests/Makefile])
+AC_CONFIG_FILES([src/hooks/dhcp/pgsql_lb/tests/Makefile])
AC_CONFIG_FILES([src/hooks/dhcp/run_script/Makefile])
AC_CONFIG_FILES([src/hooks/dhcp/run_script/libloadtests/Makefile])
AC_CONFIG_FILES([src/hooks/dhcp/run_script/tests/Makefile])
# This list is ordered alphabetically. When adding new files, please maintain
# this order.
-dhcp4_unittests_SOURCES = classify_unittest.cc
+dhcp4_unittests_SOURCES =
+dhcp4_unittests_SOURCES += classify_unittest.cc
dhcp4_unittests_SOURCES += client_handler_unittest.cc
dhcp4_unittests_SOURCES += config_parser_unittest.cc
dhcp4_unittests_SOURCES += config_backend_unittest.cc
# This list is ordered alphabetically. When adding new files, please maintain
# this order.
-dhcp6_unittests_SOURCES = classify_unittests.cc
+dhcp6_unittests_SOURCES =
+dhcp6_unittests_SOURCES += classify_unittests.cc
dhcp6_unittests_SOURCES += client_handler_unittest.cc
dhcp6_unittests_SOURCES += config_parser_unittest.cc
dhcp6_unittests_SOURCES += config_backend_unittest.cc
SUBDIRS = bootp flex_option high_availability lease_cmds perfmon
if HAVE_MYSQL
-SUBDIRS += mysql_lb
-SUBDIRS += mysql_hb
-SUBDIRS += mysql_cb
+SUBDIRS += mysql_lb mysql_hb mysql_cb
endif
if HAVE_PGSQL
-SUBDIRS += pgsql_lb
-SUBDIRS += pgsql_hb
-SUBDIRS += pgsql_cb
+SUBDIRS += pgsql_lb pgsql_hb pgsql_cb
endif
SUBDIRS += run_script stat_cmds user_chk
messages mysql_hb_messages.h mysql_hb_messages.cc:
@echo Messages generation disabled. Configure with --enable-generate-messages to enable it.
-endif
\ No newline at end of file
+endif
+
mysql_hb_unittests_LDADD += $(LOG4CPLUS_LIBS) $(CRYPTO_LIBS) $(BOOST_LIBS) $(GTEST_LDADD)
endif
-noinst_PROGRAMS = $(TESTS)
\ No newline at end of file
+noinst_PROGRAMS = $(TESTS)
+
Initializer<MySqlHostDataSourceInit> init_;
};
-// Tests that MySQL lease manager and host data source can be created from a
+// Tests that memfile lease manager and MySQL host data source can be created from a
// specified configuration.
TEST_F(CfgMySqlDbAccessTest, createManagers) {
CfgDbAccess cfg;
messages mysql_lb_messages.h mysql_lb_messages.cc:
@echo Messages generation disabled. Configure with --enable-generate-messages to enable it.
-endif
\ No newline at end of file
+endif
+
mysql_lb_unittests_LDADD += $(LOG4CPLUS_LIBS) $(CRYPTO_LIBS) $(BOOST_LIBS) $(GTEST_LDADD)
endif
-noinst_PROGRAMS = $(TESTS)
\ No newline at end of file
+noinst_PROGRAMS = $(TESTS)
+
messages pgsql_hb_messages.h pgsql_hb_messages.cc:
@echo Messages generation disabled. Configure with --enable-generate-messages to enable it.
-endif
\ No newline at end of file
+endif
+
pgsql_hb_unittests_LDADD += $(LOG4CPLUS_LIBS) $(CRYPTO_LIBS) $(BOOST_LIBS) $(GTEST_LDADD)
endif
-noinst_PROGRAMS = $(TESTS)
\ No newline at end of file
+noinst_PROGRAMS = $(TESTS)
+
Initializer<PgSqlHostDataSourceInit> init_;
};
-// Tests that PostgreSQL lease manager and host data source can be created from a
+// Tests that memfile lease manager and PostgreSQL host data source can be created from a
// specified configuration.
TEST_F(CfgPgSqlDbAccessTest, createManagers) {
CfgDbAccess cfg;
messages pgsql_lb_messages.h pgsql_lb_messages.cc:
@echo Messages generation disabled. Configure with --enable-generate-messages to enable it.
-endif
\ No newline at end of file
+endif
+
pgsql_lb_unittests_LDADD += $(LOG4CPLUS_LIBS) $(CRYPTO_LIBS) $(BOOST_LIBS) $(GTEST_LDADD)
endif
-noinst_PROGRAMS = $(TESTS)
\ No newline at end of file
+noinst_PROGRAMS = $(TESTS)
+
isc::Exception(file, line, what) {}
};
-
/// @brief Invalid type exception
///
/// Thrown when the factory doesn't recognize the type of the backend.
isc::Exception(file, line, what) {}
};
-
/// @brief Defines a callback prototype for propagating events upward
typedef std::function<bool (util::ReconnectCtlPtr db_reconnect_ctl)> DbCallback;
/// @brief Reconnect settings.
util::ReconnectCtlPtr reconnect_ctl_;
- /// The IOService object, used for all ASIO operations.
+ /// @brief The IOService object, used for all ASIO operations.
static isc::asiolink::IOServicePtr io_service_;
};
}
};
+/// @brief RAII class to register a database backend by dynamically
+/// constructing an initialization object.
+///
+/// Used mostly in unittests.
+///
+/// @tparam T The initialization class which registers the database backend
+/// on constructor and deregisters it on destructor.
template <typename T>
struct Initializer {
/// @brief Constructor.
Initializer() : init_(new T()) {
}
- /// @brief Destructo.
+ /// @brief Destructor.
~Initializer() = default;
- /// @brief smart pointer to an instance of an initializer.
+ /// @brief Smart pointer to an instance of an initializer.
std::unique_ptr<T> init_;
};