Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Sebastian Schrader
Kea
Commits
a9e9a2b2
Commit
a9e9a2b2
authored
Feb 24, 2011
by
JINMEI Tatuya
Browse files
[trac613] avoid the obvious form of self assignment to silence cppcheck.
parent
f54d8505
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/lib/dns/tests/name_unittest.cc
View file @
a9e9a2b2
...
...
@@ -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
)
{
...
...
src/lib/dns/tests/rdata_unittest.cc
View file @
a9e9a2b2
...
...
@@ -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
)
{
...
...
src/lib/dns/tests/tsigkey_unittest.cc
View file @
a9e9a2b2
...
...
@@ -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
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment