Commit be888636 authored by JINMEI Tatuya's avatar JINMEI Tatuya
Browse files

[trac613] canceled the workaround change for 'selfassignment' in tests.

exclude these warnings in the suppress list instead.
also added some comments about the suppress list.
parent 25747d9b
// On some systems cppcheck produces false alarms about 'missing includes'.
// the following two will suppress, depending on the cppcheck version
debug
missingInclude
// This is a template, and should be excluded from the check
unreadVariable:src/lib/dns/rdata/template.cc:59 unreadVariable:src/lib/dns/rdata/template.cc:59
// These two trigger warnings due to the incomplete implementation. This is
// our problem, but we need to suppress the warnings for now.
functionConst:src/lib/cache/message_cache.h functionConst:src/lib/cache/message_cache.h
functionConst:src/lib/cache/rrset_cache.h functionConst:src/lib/cache/rrset_cache.h
debug // Intentional self assignment tests. Suppress warning about them.
missingInclude selfAssignment:src/lib/dns/tests/name_unittest.cc:292
selfAssignment:src/lib/dns/tests/rdata_unittest.cc:227
selfAssignment:src/lib/dns/tests/tsigkey_unittest.cc:104
...@@ -288,10 +288,9 @@ TEST_F(NameTest, assignment) { ...@@ -288,10 +288,9 @@ TEST_F(NameTest, assignment) {
delete copy2; delete copy2;
EXPECT_EQ(copy3, example_name); EXPECT_EQ(copy3, example_name);
// Self assignment (via a reference to silence cppcheck) // Self assignment
Name& copyref(copy); copy = copy;
copyref = copy; EXPECT_EQ(example_name, copy);
EXPECT_EQ(example_name, copyref);
} }
TEST_F(NameTest, toText) { TEST_F(NameTest, toText) {
......
...@@ -223,10 +223,9 @@ TEST_F(Rdata_Unknown_Test, assignment) { ...@@ -223,10 +223,9 @@ TEST_F(Rdata_Unknown_Test, assignment) {
delete copy2; delete copy2;
EXPECT_EQ(0, copy3.compare(rdata_unknown)); EXPECT_EQ(0, copy3.compare(rdata_unknown));
// Self assignment (via a reference to silence cppcheck) // Self assignment
generic::Generic& copyref(copy); copy = copy;
copyref = copy; EXPECT_EQ(0, copy.compare(rdata_unknown));
EXPECT_EQ(0, copyref.compare(rdata_unknown));
} }
TEST_F(Rdata_Unknown_Test, toText) { TEST_F(Rdata_Unknown_Test, toText) {
......
...@@ -100,10 +100,9 @@ TEST_F(TSIGKeyTest, assignment) { ...@@ -100,10 +100,9 @@ TEST_F(TSIGKeyTest, assignment) {
delete copy2; delete copy2;
compareTSIGKeys(original, copy3); compareTSIGKeys(original, copy3);
// self assignment (via a reference to silence cppcheck) // self assignment
TSIGKey& copyref(copy); copy = copy;
copyref = copy; compareTSIGKeys(original, copy);
compareTSIGKeys(original, copyref);
} }
class TSIGKeyRingTest : public ::testing::Test { class TSIGKeyRingTest : public ::testing::Test {
......
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