BIND 10 trac1144, updated. 0b46c391a973bb8d3f0a1681eb0a79e8a196f0f0 [1144] src/lib/dns/rdata/generic/detail/ds_like.h: bug fixed for a faling unittest case + cosmetic/style change src/lib/dns/tests/rdata_ds_like_unittest.cc: a previously failing test case enabled

BIND 10 source code commits bind10-changes at lists.isc.org
Tue Sep 27 20:59:00 UTC 2011


The branch, trac1144 has been updated
       via  0b46c391a973bb8d3f0a1681eb0a79e8a196f0f0 (commit)
       via  5e5743ecb40da81c4e8ad27ac8b158c9a7aaff87 (commit)
       via  9c95bf79406ae791e2f8c7263ff4fddb19d0eda4 (commit)
      from  b6dd72042939ca62d9ceeb80385eedc7c5f0560d (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 0b46c391a973bb8d3f0a1681eb0a79e8a196f0f0
Author: Dima Volodin <dvv at isc.org>
Date:   Tue Sep 27 11:28:18 2011 -0400

    [1144]	src/lib/dns/rdata/generic/detail/ds_like.h:
    	bug fixed for a faling unittest case + cosmetic/style change
    	src/lib/dns/tests/rdata_ds_like_unittest.cc:
    	a previously failing test case enabled

commit 5e5743ecb40da81c4e8ad27ac8b158c9a7aaff87
Author: Dima Volodin <dvv at isc.org>
Date:   Tue Sep 27 11:26:10 2011 -0400

    [1144]	proposed new DLV entry in ChangeLog

commit 9c95bf79406ae791e2f8c7263ff4fddb19d0eda4
Author: Dima Volodin <dvv at isc.org>
Date:   Tue Sep 27 11:24:43 2011 -0400

    [1144]	style/cosmetic changes in ds_43.{h,cc} and dlv_32769.{h,cc}

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

Summary of changes:
 ChangeLog                                   |    4 ++++
 src/lib/dns/rdata/generic/detail/ds_like.h  |   12 +++++++++++-
 src/lib/dns/rdata/generic/dlv_32769.cc      |    5 +----
 src/lib/dns/rdata/generic/dlv_32769.h       |    2 +-
 src/lib/dns/rdata/generic/ds_43.cc          |    5 +----
 src/lib/dns/rdata/generic/ds_43.h           |    2 +-
 src/lib/dns/tests/rdata_ds_like_unittest.cc |   22 ++++++++--------------
 7 files changed, 27 insertions(+), 25 deletions(-)

-----------------------------------------------------------------------
diff --git a/ChangeLog b/ChangeLog
index 5a14558..f2c3edc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+278.	[func]		dvv
+	Implement the DLV rrtype according to RFC4431.
+	(Trac #1144, git TBD)
+
 277.	[func]		jerry
 	Implement the SRV rrtype according to RFC2782.
 	(Trac #1128, git 5fd94aa027828c50e63ae1073d9d6708e0a9c223)
diff --git a/src/lib/dns/rdata/generic/detail/ds_like.h b/src/lib/dns/rdata/generic/detail/ds_like.h
index da3ade4..1061ece 100644
--- a/src/lib/dns/rdata/generic/detail/ds_like.h
+++ b/src/lib/dns/rdata/generic/detail/ds_like.h
@@ -64,10 +64,12 @@ public:
     /// parameter data for any of the number of reasons.
     DSLikeImpl(const std::string& ds_str) {
         std::istringstream iss(ds_str);
+        // peekc should be of iss's char_type for isspace to work
+        std::istringstream::char_type peekc;
         std::stringbuf digestbuf;
         uint32_t tag, algorithm, digest_type;
 
-        iss >> tag >> algorithm >> digest_type >> &digestbuf;
+        iss >> tag >> algorithm >> digest_type;
         if (iss.bad() || iss.fail()) {
             isc_throw(InvalidRdataText,
                       "Invalid " << RRType(typeCode) << " text");
@@ -85,6 +87,14 @@ public:
                       RRType(typeCode) << " digest type out of range");
         }
 
+        peekc = iss.peek();
+        if (!iss.good() || !isspace(peekc, iss.getloc())) {
+            isc_throw(InvalidRdataText,
+                      RRType(typeCode) << " presentation format error");
+        }
+
+        iss >> &digestbuf;
+
         tag_ = tag;
         algorithm_ = algorithm;
         digest_type_ = digest_type;
diff --git a/src/lib/dns/rdata/generic/dlv_32769.cc b/src/lib/dns/rdata/generic/dlv_32769.cc
index 4e2d780..9887aa8 100644
--- a/src/lib/dns/rdata/generic/dlv_32769.cc
+++ b/src/lib/dns/rdata/generic/dlv_32769.cc
@@ -1,4 +1,4 @@
-// Copyright (C) 2010  Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2011  Internet Systems Consortium, Inc. ("ISC")
 //
 // Permission to use, copy, modify, and/or distribute this software for any
 // purpose with or without fee is hereby granted, provided that the above
@@ -21,9 +21,6 @@
 #include <dns/rdata.h>
 #include <dns/rdataclass.h>
 
-#include <stdio.h>
-#include <time.h>
-
 #include <dns/rdata/generic/detail/ds_like.h>
 
 using namespace std;
diff --git a/src/lib/dns/rdata/generic/dlv_32769.h b/src/lib/dns/rdata/generic/dlv_32769.h
index 30128fb..86cd98c 100644
--- a/src/lib/dns/rdata/generic/dlv_32769.h
+++ b/src/lib/dns/rdata/generic/dlv_32769.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2010  Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2011  Internet Systems Consortium, Inc. ("ISC")
 //
 // Permission to use, copy, modify, and/or distribute this software for any
 // purpose with or without fee is hereby granted, provided that the above
diff --git a/src/lib/dns/rdata/generic/ds_43.cc b/src/lib/dns/rdata/generic/ds_43.cc
index 5535d9d..20b62dc 100644
--- a/src/lib/dns/rdata/generic/ds_43.cc
+++ b/src/lib/dns/rdata/generic/ds_43.cc
@@ -1,4 +1,4 @@
-// Copyright (C) 2010  Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2011  Internet Systems Consortium, Inc. ("ISC")
 //
 // Permission to use, copy, modify, and/or distribute this software for any
 // purpose with or without fee is hereby granted, provided that the above
@@ -23,9 +23,6 @@
 
 #include <dns/rdata/generic/detail/ds_like.h>
 
-#include <stdio.h>
-#include <time.h>
-
 using namespace std;
 using namespace isc::util;
 using namespace isc::util::encode;
diff --git a/src/lib/dns/rdata/generic/ds_43.h b/src/lib/dns/rdata/generic/ds_43.h
index 52f2f0b..2697f51 100644
--- a/src/lib/dns/rdata/generic/ds_43.h
+++ b/src/lib/dns/rdata/generic/ds_43.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2010  Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2011  Internet Systems Consortium, Inc. ("ISC")
 //
 // Permission to use, copy, modify, and/or distribute this software for any
 // purpose with or without fee is hereby granted, provided that the above
diff --git a/src/lib/dns/tests/rdata_ds_like_unittest.cc b/src/lib/dns/tests/rdata_ds_like_unittest.cc
index daf0dd4..95610e1 100644
--- a/src/lib/dns/tests/rdata_ds_like_unittest.cc
+++ b/src/lib/dns/tests/rdata_ds_like_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (C) 2010  Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2011  Internet Systems Consortium, Inc. ("ISC")
 //
 // Permission to use, copy, modify, and/or distribute this software for any
 // purpose with or without fee is hereby granted, provided that the above
@@ -62,8 +62,7 @@ typedef testing::Types<generic::DS, generic::DLV> Implementations;
 TYPED_TEST_CASE(Rdata_DS_LIKE_Test, Implementations);
 
 TYPED_TEST(Rdata_DS_LIKE_Test, toText_DS_LIKE) {
-    EXPECT_EQ(ds_like_txt,
-              Rdata_DS_LIKE_Test<TypeParam>::rdata_ds_like.toText());
+    EXPECT_EQ(ds_like_txt, this->rdata_ds_like.toText());
 }
 
 TYPED_TEST(Rdata_DS_LIKE_Test, badText_DS_LIKE) {
@@ -74,11 +73,6 @@ TYPED_TEST(Rdata_DS_LIKE_Test, badText_DS_LIKE) {
                  InvalidRdataText);
     EXPECT_THROW(const TypeParam ds_like2("11111 5 2"), InvalidRdataText);
     EXPECT_THROW(const TypeParam ds_like2("GARBAGE IN"), InvalidRdataText);
-}
-
-// this test currently fails; we must fix it, and then migrate the test to
-// badText_DS_LIKE
-TYPED_TEST(Rdata_DS_LIKE_Test, DISABLED_badText_DS_LIKE) {
     // no space between the digest type and the digest.
     EXPECT_THROW(const TypeParam ds_like2(
                      "12892 5 2F1E184C0E1D615D20EB3C223ACED3B03C773DD952D"
@@ -86,7 +80,7 @@ TYPED_TEST(Rdata_DS_LIKE_Test, DISABLED_badText_DS_LIKE) {
 }
 
 TYPED_TEST(Rdata_DS_LIKE_Test, createFromWire_DS_LIKE) {
-    EXPECT_EQ(0, Rdata_DS_LIKE_Test<TypeParam>::rdata_ds_like.compare(
+    EXPECT_EQ(0, this->rdata_ds_like.compare(
               *this->rdataFactoryFromFile(RRTYPE<TypeParam>(), RRClass::IN(),
                                           "rdata_ds_fromWire")));
 }
@@ -109,26 +103,26 @@ TYPED_TEST(Rdata_DS_LIKE_Test, assignment_DS_LIKE) {
 }
 
 TYPED_TEST(Rdata_DS_LIKE_Test, getTag_DS_LIKE) {
-    EXPECT_EQ(12892, Rdata_DS_LIKE_Test<TypeParam>::rdata_ds_like.getTag());
+    EXPECT_EQ(12892, this->rdata_ds_like.getTag());
 }
 
 TYPED_TEST(Rdata_DS_LIKE_Test, toWireRenderer) {
     Rdata_DS_LIKE_Test<TypeParam>::renderer.skip(2);
     TypeParam rdata_ds_like(ds_like_txt);
-    rdata_ds_like.toWire(Rdata_DS_LIKE_Test<TypeParam>::renderer);
+    rdata_ds_like.toWire(this->renderer);
 
     vector<unsigned char> data;
     UnitTestUtil::readWireData("rdata_ds_fromWire", data);
     EXPECT_PRED_FORMAT4(UnitTestUtil::matchWireData,
                         static_cast<const uint8_t*>
-                        (Rdata_DS_LIKE_Test<TypeParam>::obuffer.getData()) + 2,
-                        Rdata_DS_LIKE_Test<TypeParam>::obuffer.getLength() - 2,
+                        (this->obuffer.getData()) + 2,
+                        this->obuffer.getLength() - 2,
                         &data[2], data.size() - 2);
 }
 
 TYPED_TEST(Rdata_DS_LIKE_Test, toWireBuffer) {
     TypeParam rdata_ds_like(ds_like_txt);
-    rdata_ds_like.toWire(Rdata_DS_LIKE_Test<TypeParam>::obuffer);
+    rdata_ds_like.toWire(this->obuffer);
 }
 
 TYPED_TEST(Rdata_DS_LIKE_Test, compare) {




More information about the bind10-changes mailing list