static void logChanges(S_Session sess, const std::string& model);
#endif
- /// @brief Cancel flag.
- bool cancel_;
-
protected:
/// @brief Get and display Kea server configuration.
///
/// @brief Test fixture class for http control sockets.
class HttpControlSocketTest : public ThreadedTest {
public:
+ /// @brief Constructor
HttpControlSocketTest()
: ThreadedTest(), io_service_() {
}
/// @brief Pointer to listener.
HttpListenerPtr listener_;
-
- /// @brief Done flag (stopping thread).
- bool done_;
-
- /// @brief Finished flag (stopped thread).
- bool finished_;
};
/// @brief Create the reflecting listener.
/// \param name name of the counter used in log file.
CustomCounter(const std::string& name) :
counter_(0),
- name_(name) { };
+ name_(name) {
+ }
/// \brief Increment operator.
const CustomCounter& operator++() {
///
/// Method returns counter value.
///
- /// \return counter value.
- uint64_t getValue() const { return(counter_); }
+ /// \return counter value.
+ uint64_t getValue() const {
+ return (counter_);
+ }
/// \brief Return counter name.
///
/// Method returns counter name.
///
- /// \return counter name.
- const std::string& getName() const { return(name_); }
+ /// \return counter name.
+ const std::string& getName() const {
+ return (name_);
+ }
private:
/// \brief Default constructor.
/// Default constructor is private because we don't want client
/// class to call it because we want client class to specify
/// counter's name.
- CustomCounter() { };
+ CustomCounter() : counter_(0) {
+ }
uint64_t counter_; ///< Counter's value.
std::string name_; ///< Counter's name.
}
result.replace(where, from.size(), repl);
}
+ return (result);
}
};
/// @throw isc::db::DbOpenError Error opening the database
/// @throw isc::db::DbOperationError An operation on the open database has
/// failed.
- PgSqlHostDataSource(const db::DatabaseConnection::ParameterMap& parameters);
+ PgSqlHostDataSource(const db::DatabaseConnection::ParameterMap& parameters);
/// @brief Virtual destructor.
+ ///
/// Frees database resources and closes the database connection through
/// the destruction of member impl_.
virtual ~PgSqlHostDataSource();
/// @brief Test fixture class for @c MultiThreadingConfigParser
class CfgMultiThreadingTest : public ::testing::Test {
+public:
+
+ /// @brief Constructor
+ CfgMultiThreadingTest() = default;
+
+ /// @brief Destructor
+ virtual ~CfgMultiThreadingTest() = default;
+
protected:
/// @brief Setup for each test.
/// @brief Test class for execerising manager functions that are
/// influenced by DDNS parameters.
class D2ClientMgrParamsTest : public ::testing::Test {
+public:
+ /// @brief Constructor
+ D2ClientMgrParamsTest() = default;
+
+ /// @brief Destructor
+ virtual ~D2ClientMgrParamsTest() = default;
+
private:
/// @brief Prepares the class for a test.
virtual void SetUp() {
/// @brief Test fixture class for @c DHCPQueueControlParser
class DHCPQueueControlParserTest : public ::testing::Test {
-protected:
+public:
+ /// @brief Constructor
+ DHCPQueueControlParserTest() = default;
+
+ /// @brief Destructor
+ virtual ~DHCPQueueControlParserTest() = default;
+protected:
/// @brief Setup for each test.
///
/// Clears the configuration in the @c CfgMgr.
///
/// Clears the configuration in the @c CfgMgr.
virtual void TearDown();
-
};
void
// @brief Test fixture class
class HostDataSourceFactoryTest : public ::testing::Test {
+public:
+ /// @brief Constructor
+ HostDataSourceFactoryTest() = default;
+
+ /// @brief Destructor
+ virtual ~HostDataSourceFactoryTest() = default;
+
private:
// @brief Prepares the class for a test.
virtual void SetUp() {
/// @brief Test fixture class for @c HostReservationParser.
class HostReservationParserTest : public ::testing::Test {
-protected:
+public:
+ /// @brief Constructor
+ HostReservationParserTest() = default;
+ /// @brief Destructor
+ virtual ~HostReservationParserTest() = default;
+
+protected:
/// @brief Setup for each test.
///
/// Clears the configuration in the @c CfgMgr.
/// @brief Test fixture class for @c HostReservationsListParser.
class HostReservationsListParserTest : public ::testing::Test {
-protected:
+public:
+ /// @brief Constructor
+ HostReservationsListParserTest() = default;
+ /// @brief Destructor
+ virtual ~HostReservationsListParserTest() = default;
+
+protected:
/// @brief Setup for each test.
///
/// Clears the configuration in the @c CfgMgr. It also initializes
/// @brief Destructor
///
/// Removes any configuration that may have been added in CfgMgr.
- ~LeaseFileLoaderTest();
+ virtual ~LeaseFileLoaderTest();
/// @brief Prepends the absolute path to the file specified
/// as an argument.
/// @brief Test fixture class for @c MultiThreadingConfigParser
class MultiThreadingConfigParserTest : public ::testing::Test {
+public:
+
+ /// @brief Constructor
+ MultiThreadingConfigParserTest() = default;
+
+ /// @brief Destructor
+ virtual ~MultiThreadingConfigParserTest() = default;
+
protected:
/// @brief Setup for each test.
: d2_mgr_(CfgMgr::instance().getD2ClientMgr()), lease_() {
}
+ /// @brief Destructor
+ virtual ~NCRGeneratorTest() = default;
+
/// @brief Initializes the lease pointer used by the tests and starts D2.
///
/// This method initializes the pointer to the lease which will be used
/// @brief Test fixture class for @c TimerMgr.
class TimerMgrTest : public ::testing::Test {
+public:
+
+ /// @brief Constructor
+ TimerMgrTest() = default;
+
+ /// @brief Destructor
+ virtual ~TimerMgrTest() = default;
+
private:
+
/// @brief Prepares the class for a test.
virtual void SetUp();
/// @brief Test fixture class for @c HostMgr class.
class HostMgrTest : public ::testing::Test {
+public:
+
+ /// @brief Constructor
+ HostMgrTest() = default;
+
+ /// @brief Destructor
+ virtual ~HostMgrTest() = default;
+
protected:
/// @brief Prepares the class for a test.
class MemHostDataSource : public virtual BaseHostDataSource {
public:
+ /// @brief Constructor.
+ MemHostDataSource() : next_host_id_(0) {
+ }
+
/// @brief Destructor.
- virtual ~MemHostDataSource() { }
+ virtual ~MemHostDataSource() = default;
/// BaseHostDataSource methods.
/// of the dependency of classification expressions.
class DependencyTest : public ::testing::Test {
public:
+ /// @brief Constructor
+ DependencyTest() : result_(true) {
+ }
- /// @brief Reset expression and result.
+ /// @brief Destructor
+ ///
+ /// Reset expression and result.
~DependencyTest() {
e_.reset();
result_ = false;
class LoggingInfoTest : public ::testing::Test {
public:
+ /// @brief Constructor
+ LoggingInfoTest() = default;
+
+ /// @brief Destructor
+ virtual ~LoggingInfoTest() = default;
+
/// @brief Setup the test.
virtual void SetUp() {
Daemon::setVerbose(false);
}
/// \brief Destructor
- ~ OutputBuffer() {
+ ~OutputBuffer() {
free(buffer_);
}
//@}
const int SOCKSESSION_BUFSIZE = (DEFAULT_HEADER_BUFLEN + MAX_DATASIZE) * 2;
struct SocketSessionForwarder::ForwarderImpl {
- ForwarderImpl() : fd_(-1), buf_(DEFAULT_HEADER_BUFLEN) {}
+ ForwarderImpl() : sock_un_len_(0), fd_(-1), buf_(DEFAULT_HEADER_BUFLEN) {
+ memset(&sock_un_, 0, sizeof(sock_un_));
+ }
+
struct sockaddr_un sock_un_;
socklen_t sock_un_len_;
int fd_;
const size_t TEST_DATA_SIZE = 8 * 1024 * 1024;
class FDTest : public ::testing::Test {
- public:
- unsigned char *data, *buffer;
- FDTest() :
- // We do not care what is inside, we just need it to be the same
- data(new unsigned char[TEST_DATA_SIZE]),
- buffer(NULL)
- {
- memset(data, 0, TEST_DATA_SIZE);
- }
- ~ FDTest() {
- delete[] data;
- delete[] buffer;
- }
+public:
+ unsigned char *data, *buffer;
+
+ /// @brief Constructor
+ FDTest() :
+ // We do not care what is inside, we just need it to be the same
+ data(new unsigned char[TEST_DATA_SIZE]),
+ buffer(NULL) {
+ memset(data, 0, TEST_DATA_SIZE);
+ }
+
+ /// @brief Destructor
+ ~FDTest() {
+ delete[] data;
+ delete[] buffer;
+ }
};
// Test we read what was sent
class PIDFileTest : public ::testing::Test {
public:
+
+ /// @brief Constructor
+ PIDFileTest() = default;
+
+ /// @brief Destructor
+ virtual ~PIDFileTest() = default;
+
/// @brief Prepends the absolute path to the file specified
/// as an argument.
///
/// @brief Test fixture class for testing @c StopwatchImpl.
class StopwatchTest : public ::testing::Test {
+public:
+
+ /// @brief Constructor
+ StopwatchTest() = default;
+
+ /// @brief Destructor
+ virtual ~StopwatchTest() = default;
+
protected:
/// @brief Set up the test.