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

[trac613] avoid the obvious form of self assignment to silence cppcheck.

parent f54d8505
......@@ -288,9 +288,10 @@ TEST_F(NameTest, assignment) {
delete copy2;
EXPECT_EQ(copy3, example_name);
// Self assignment
copy = copy;
EXPECT_EQ(copy, example_name);
// Self assignment (via a reference to silence cppcheck)
Name& copyref(copy);
copyref = copy;
EXPECT_EQ(example_name, copyref);
}
TEST_F(NameTest, toText) {
......
......@@ -223,9 +223,10 @@ TEST_F(Rdata_Unknown_Test, assignment) {
delete copy2;
EXPECT_EQ(0, copy3.compare(rdata_unknown));
// Self assignment
copy = copy;
EXPECT_EQ(0, copy.compare(rdata_unknown));
// Self assignment (via a reference to silence cppcheck)
generic::Generic& copyref(copy);
copyref = copy;
EXPECT_EQ(0, copyref.compare(rdata_unknown));
}
TEST_F(Rdata_Unknown_Test, toText) {
......
......@@ -100,9 +100,10 @@ TEST_F(TSIGKeyTest, assignment) {
delete copy2;
compareTSIGKeys(original, copy3);
// self assignment
copy = copy;
compareTSIGKeys(original, copy);
// self assignment (via a reference to silence cppcheck)
TSIGKey& copyref(copy);
copyref = copy;
compareTSIGKeys(original, copyref);
}
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