Commit 659493d4 authored by Marcin Siodelski's avatar Marcin Siodelski

[3736] Suppress cppcheck warnings about the SetUp/TearDown unused.

parent 69572795
......@@ -73,9 +73,19 @@ TEST(Dhcp4SpecTest, basicSpec) {
}
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.
......@@ -85,15 +95,7 @@ public:
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 =
......
......@@ -388,7 +388,9 @@ Dhcpv4SrvTest::createPacketFromBuffer(const Pkt4Ptr& src_pkt,
return (::testing::AssertionSuccess());
}
void Dhcpv4SrvTest::TearDown() {
void
// cppcheck-suppress unusedFunction
Dhcpv4SrvTest::TearDown() {
CfgMgr::instance().clear();
......
......@@ -71,6 +71,16 @@ TEST(Dhcp6SpecTest, basicSpec) {
}
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
......@@ -99,15 +109,6 @@ public:
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();
......
......@@ -52,6 +52,7 @@ protected:
};
void
// cppcheck-suppress unusedFunction
HostMgrTest::SetUp() {
// Remove all configuration which may be dangling from the previous test.
CfgMgr::instance().clear();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment