}
class Dhcp4ParserTest : public ::testing::Test {
+protected:
+ // Check that no hooks libraries are loaded. This is a pre-condition for
+ // a number of tests, so is checked in one place. As this uses an
+ // ASSERT call - and it is not clear from the documentation that Gtest
+ // predicates can be used in a constructor - the check is placed in SetUp.
+ virtual void SetUp() {
+ std::vector<std::string> libraries = HooksManager::getLibraryNames();
+ ASSERT_TRUE(libraries.empty());
+ }
+
public:
Dhcp4ParserTest()
- :rcode_(-1) {
+ : rcode_(-1) {
// Open port 0 means to not do anything at all. We don't want to
// deal with sockets here, just check if configuration handling
// is sane.
resetConfiguration();
}
- // Check that no hooks libraries are loaded. This is a pre-condition for
- // a number of tests, so is checked in one place. As this uses an
- // ASSERT call - and it is not clear from the documentation that Gtest
- // predicates can be used in a constructor - the check is placed in SetUp.
- void SetUp() {
- std::vector<std::string> libraries = HooksManager::getLibraryNames();
- ASSERT_TRUE(libraries.empty());
- }
-
+public:
// Checks if global parameter of name have expected_value
void checkGlobalUint32(string name, uint32_t expected_value) {
const Uint32StoragePtr uint32_defaults =
return (::testing::AssertionSuccess());
}
-void Dhcpv4SrvTest::TearDown() {
+void
+// cppcheck-suppress unusedFunction
+Dhcpv4SrvTest::TearDown() {
CfgMgr::instance().clear();
}
class Dhcp6ParserTest : public ::testing::Test {
+protected:
+ // Check that no hooks libraries are loaded. This is a pre-condition for
+ // a number of tests, so is checked in one place. As this uses an
+ // ASSERT call - and it is not clear from the documentation that Gtest
+ // predicates can be used in a constructor - the check is placed in SetUp.
+ virtual void SetUp() {
+ std::vector<std::string> libraries = HooksManager::getLibraryNames();
+ ASSERT_TRUE(libraries.empty());
+ }
+
public:
Dhcp6ParserTest() :rcode_(-1), srv_(0) {
// srv_(0) means to not open any sockets. We don't want to
resetConfiguration();
}
- // Check that no hooks libraries are loaded. This is a pre-condition for
- // a number of tests, so is checked in one place. As this uses an
- // ASSERT call - and it is not clear from the documentation that Gtest
- // predicates can be used in a constructor - the check is placed in SetUp.
- void SetUp() {
- std::vector<std::string> libraries = HooksManager::getLibraryNames();
- ASSERT_TRUE(libraries.empty());
- }
-
~Dhcp6ParserTest() {
// Reset configuration database after each test.
resetConfiguration();
};
void
+// cppcheck-suppress unusedFunction
HostMgrTest::SetUp() {
// Remove all configuration which may be dangling from the previous test.
CfgMgr::instance().clear();