BIND 10 trac2522, updated. 64bc0886402d587b65343fe6faecf35ed59eb029 [2522] revised "copy" test for SSHFP: make sure to use assignment, not copy.

BIND 10 source code commits bind10-changes at lists.isc.org
Thu May 23 22:07:48 UTC 2013


The branch, trac2522 has been updated
       via  64bc0886402d587b65343fe6faecf35ed59eb029 (commit)
       via  8ed9ddfe7f17d01d29cdaed8ee800487413e8632 (commit)
      from  e08a21c3bdc637a447d68da727fa3f4cb6a26112 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 64bc0886402d587b65343fe6faecf35ed59eb029
Author: JINMEI Tatuya <jinmei at isc.org>
Date:   Thu May 23 15:07:29 2013 -0700

    [2522] revised "copy" test for SSHFP: make sure to use assignment, not copy.

commit 8ed9ddfe7f17d01d29cdaed8ee800487413e8632
Author: JINMEI Tatuya <jinmei at isc.org>
Date:   Thu May 23 15:07:16 2013 -0700

    [2522] minor style matter: brace position

-----------------------------------------------------------------------

Summary of changes:
 src/lib/dns/rdata/generic/sshfp_44.cc     |    3 +--
 src/lib/dns/tests/rdata_sshfp_unittest.cc |   10 ++++++----
 2 files changed, 7 insertions(+), 6 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/lib/dns/rdata/generic/sshfp_44.cc b/src/lib/dns/rdata/generic/sshfp_44.cc
index dc74050..c7199f3 100644
--- a/src/lib/dns/rdata/generic/sshfp_44.cc
+++ b/src/lib/dns/rdata/generic/sshfp_44.cc
@@ -198,8 +198,7 @@ SSHFP::SSHFP(const SSHFP& other) :
 {}
 
 SSHFP&
-SSHFP::operator=(const SSHFP& source)
-{
+SSHFP::operator=(const SSHFP& source) {
     if (impl_ == source.impl_) {
         return (*this);
     }
diff --git a/src/lib/dns/tests/rdata_sshfp_unittest.cc b/src/lib/dns/tests/rdata_sshfp_unittest.cc
index 7df24d5..b85dfa5 100644
--- a/src/lib/dns/tests/rdata_sshfp_unittest.cc
+++ b/src/lib/dns/tests/rdata_sshfp_unittest.cc
@@ -152,12 +152,14 @@ TEST_F(Rdata_SSHFP_Test, badText) {
     checkFromText_LexerError("2 -1 123456789abcdef67890123456789abcdef67890");
 }
 
-TEST_F(Rdata_SSHFP_Test, copy) {
-    const generic::SSHFP rdata_sshfp2(rdata_sshfp);
+TEST_F(Rdata_SSHFP_Test, copyAndAssign) {
+    // Copy construct
+    generic::SSHFP rdata_sshfp2(rdata_sshfp);
     EXPECT_EQ(0, rdata_sshfp.compare(rdata_sshfp2));
 
-    const generic::SSHFP rdata_sshfp3 = rdata_sshfp;
-    EXPECT_EQ(0, rdata_sshfp.compare(rdata_sshfp3));
+    // Assignment, mainly to confirm it doesn't cause disruption.
+    rdata_sshfp2 = rdata_sshfp;
+    EXPECT_EQ(0, rdata_sshfp.compare(rdata_sshfp2));
 }
 
 TEST_F(Rdata_SSHFP_Test, createFromWire) {



More information about the bind10-changes mailing list