BIND 10 trac2522, updated. 7482587271347cc071f95cf1709a0370c0087fd7 [2522] some simple suggested fixes:

BIND 10 source code commits bind10-changes at lists.isc.org
Wed May 15 00:31:38 UTC 2013


The branch, trac2522 has been updated
       via  7482587271347cc071f95cf1709a0370c0087fd7 (commit)
      from  8c06e54ac7cdefa669326da0280294ea88196575 (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 7482587271347cc071f95cf1709a0370c0087fd7
Author: JINMEI Tatuya <jinmei at isc.org>
Date:   Tue May 14 17:30:03 2013 -0700

    [2522] some simple suggested fixes:
    
    - use the unnamed namespace for the entire content to hide as many things as
      possible.
    - define rdata_tsig inside the fixture class to avoid initialization fiasco.
      (to make it possible, also make toWireCommonChecks a member function).

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

Summary of changes:
 src/lib/dns/tests/rdata_tsig_unittest.cc |   13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/lib/dns/tests/rdata_tsig_unittest.cc b/src/lib/dns/tests/rdata_tsig_unittest.cc
index b73c4dd..7b16730 100644
--- a/src/lib/dns/tests/rdata_tsig_unittest.cc
+++ b/src/lib/dns/tests/rdata_tsig_unittest.cc
@@ -37,6 +37,7 @@ using namespace isc::dns;
 using namespace isc::util;
 using namespace isc::dns::rdata;
 
+namespace {
 const char* const valid_text1 = "hmac-md5.sig-alg.reg.int. 1286779327 300 "
     "0 16020 BADKEY 0";
 const char* const valid_text2 = "hmac-sha256. 1286779327 300 12 "
@@ -51,12 +52,10 @@ const char* const valid_text5 = "hmac-sha256. 1286779327 300 12 "
 const char* const too_long_label = "012345678901234567890123456789"
     "0123456789012345678901234567890123";
 
-// commonly used test RDATA
-const any::TSIG rdata_tsig((string(valid_text1)));
-
-namespace {
 class Rdata_TSIG_Test : public RdataTest {
 protected:
+    Rdata_TSIG_Test() : rdata_tsig(valid_text1) {}
+
     void checkFromText_InvalidText(const string& rdata_str) {
         checkFromText<any::TSIG, InvalidRdataText, InvalidRdataText>(
             rdata_str, rdata_tsig, true, true);
@@ -83,7 +82,11 @@ protected:
             rdata_str, rdata_tsig, true, true);
     }
 
+    template <typename Output>
+    void toWireCommonChecks(Output& output) const;
+
     vector<uint8_t> expect_data;
+    const any::TSIG rdata_tsig; // commonly used test RDATA
 };
 
 TEST_F(Rdata_TSIG_Test, fromText) {
@@ -310,7 +313,7 @@ TEST_F(Rdata_TSIG_Test, assignment) {
 
 template <typename Output>
 void
-toWireCommonChecks(Output& output) {
+Rdata_TSIG_Test::toWireCommonChecks(Output& output) const {
     vector<uint8_t> expect_data;
 
     output.clear();



More information about the bind10-changes mailing list