BIND 10 trac2164, updated. eaef6b237a71811637b5c8c5c276962a3839a85f [2164] Rename method to getRRsigDataCount() and add it to AbstractRRset's interface
BIND 10 source code commits
bind10-changes at lists.isc.org
Mon Aug 13 15:54:19 UTC 2012
The branch, trac2164 has been updated
via eaef6b237a71811637b5c8c5c276962a3839a85f (commit)
via 2bf182fa361569c5d8c3d447a475a7960ef5e229 (commit)
from 4232ef35211607d34c1b14fe73a069a6238b2d9c (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 eaef6b237a71811637b5c8c5c276962a3839a85f
Author: Mukund Sivaraman <muks at isc.org>
Date: Mon Aug 13 21:24:01 2012 +0530
[2164] Rename method to getRRsigDataCount() and add it to AbstractRRset's interface
BasicRRset implements a dummy getRRsigDataCount() which returns 0
(as getRRsig() returns NULL without throwing).
The method was renamed different to what is asked in the bug, so that
the new name is consistent with other AbstractRRset methods for RRSIGs.
commit 2bf182fa361569c5d8c3d447a475a7960ef5e229
Author: Mukund Sivaraman <muks at isc.org>
Date: Mon Aug 13 21:20:14 2012 +0530
[2164] Add virtual to the RRset::getRRsig() method
This seems to be required in our coding style.
-----------------------------------------------------------------------
Summary of changes:
src/lib/dns/rrset.cc | 2 +-
src/lib/dns/rrset.h | 39 ++++++++++++++++++++++++---------
src/lib/dns/tests/message_unittest.cc | 4 +---
src/lib/dns/tests/rrset_unittest.cc | 10 ++++-----
4 files changed, 36 insertions(+), 19 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/lib/dns/rrset.cc b/src/lib/dns/rrset.cc
index 969ae97..2bdb71f 100644
--- a/src/lib/dns/rrset.cc
+++ b/src/lib/dns/rrset.cc
@@ -250,7 +250,7 @@ RRset::RRset(const Name& name, const RRClass& rrclass,
RRset::~RRset() {}
unsigned int
-RRset::getSIGRdataCount() const {
+RRset::getRRsigDataCount() const {
if (rrsig_) {
return (rrsig_->getRdataCount());
} else {
diff --git a/src/lib/dns/rrset.h b/src/lib/dns/rrset.h
index e28621c..6c73d60 100644
--- a/src/lib/dns/rrset.h
+++ b/src/lib/dns/rrset.h
@@ -420,6 +420,15 @@ public:
/// \return Pointer to the associated RRSIG RRset or null if there is none.
virtual RRsetPtr getRRsig() const = 0;
+ /// \brief Returns the number of \c RRSIG records associated with
+ /// the \c RRset.
+ ///
+ /// Note that an \c RRset with no RRSIG records may exist, so this
+ /// method may return 0.
+ ///
+ /// \return The number of \c RRSIG records associated.
+ virtual unsigned int getRRsigDataCount() const = 0;
+
/// \brief Adds RRSIG RRset RRs to the associated RRSIG RRset
///
/// Adds the (assumed) RRSIG rdata the RRSIG RRset associated with this
@@ -764,6 +773,15 @@ public:
return (RRsetPtr());
}
+ /// \brief Returns the number of \c RRSIG records associated with
+ /// the \c RRset.
+ ///
+ /// \return Always returns 0. Associated RRSIG RRsets are not
+ /// supported in this class.
+ virtual unsigned int getRRsigDataCount() const {
+ return (0);
+ }
+
virtual void addRRsig(const rdata::ConstRdataPtr&) {
isc_throw(NotImplemented,
"BasicRRset does not implement the addRRsig() method");
@@ -810,15 +828,6 @@ public:
virtual ~RRset();
- /// \brief Returns the number of \c RRSIG records associated with
- /// the \c RRset.
- ///
- /// Note that an \c RRset with no RRSIG records may exist, so this
- /// method may return 0.
- ///
- /// \return The number of \c RRSIG records associated.
- unsigned int getSIGRdataCount() const;
-
/// \brief Updates the owner name of the \c RRset, including RRSIGs if any
virtual void setName(const Name& n) {
BasicRRset::setName(n);
@@ -876,7 +885,17 @@ public:
virtual void removeRRsig() { rrsig_ = RRsetPtr(); }
/// \brief Return a pointer to this RRset's RRSIG RRset
- RRsetPtr getRRsig() const { return (rrsig_); }
+ virtual RRsetPtr getRRsig() const { return (rrsig_); }
+
+ /// \brief Returns the number of \c RRSIG records associated with
+ /// the \c RRset.
+ ///
+ /// Note that an \c RRset with no RRSIG records may exist, so this
+ /// method may return 0.
+ ///
+ /// \return The number of \c RRSIG records associated.
+ virtual unsigned int getRRsigDataCount() const;
+
private:
RRsetPtr rrsig_;
};
diff --git a/src/lib/dns/tests/message_unittest.cc b/src/lib/dns/tests/message_unittest.cc
index 2291fd3..8bf3acc 100644
--- a/src/lib/dns/tests/message_unittest.cc
+++ b/src/lib/dns/tests/message_unittest.cc
@@ -764,9 +764,7 @@ TEST_F(MessageTest, toWireSigned) {
"20000101000000 20000201000000 "
"12345 example.com. FAKEFAKEFAKE"));
rrset_a->addRRsig(rrset_rrsig);
-
- const RRset* rr = dynamic_cast<const RRset*>(rrset_a.get());
- EXPECT_EQ(2, rr->getSIGRdataCount());
+ EXPECT_EQ(2, rrset_a->getRRsigDataCount());
message_render.addRRset(Message::SECTION_ANSWER, rrset_a, true);
diff --git a/src/lib/dns/tests/rrset_unittest.cc b/src/lib/dns/tests/rrset_unittest.cc
index 3b16a4a..4c80361 100644
--- a/src/lib/dns/tests/rrset_unittest.cc
+++ b/src/lib/dns/tests/rrset_unittest.cc
@@ -339,9 +339,9 @@ TEST_F(RRsetRRSIGTest, addRRsig) {
EXPECT_EQ(3, sp->getRdataCount());
}
-TEST_F(RRsetRRSIGTest, getSIGRdataCount) {
- EXPECT_EQ(1, rrset_aaaa->getSIGRdataCount());
- EXPECT_EQ(0, rrset_a->getSIGRdataCount());
+TEST_F(RRsetRRSIGTest, getRRsigDataCount) {
+ EXPECT_EQ(1, rrset_aaaa->getRRsigDataCount());
+ EXPECT_EQ(0, rrset_a->getRRsigDataCount());
rrset_rrsig = RRsetPtr(new RRset(test_name, RRClass::IN(),
RRType::RRSIG(), RRTTL(3600)));
@@ -354,9 +354,9 @@ TEST_F(RRsetRRSIGTest, getSIGRdataCount) {
"20000101000000 20000201000000 "
"12345 example.com. FAKEFAKEFAKE"));
rrset_a->addRRsig(rrset_rrsig);
- EXPECT_EQ(2, rrset_a->getSIGRdataCount());
+ EXPECT_EQ(2, rrset_a->getRRsigDataCount());
rrset_a->removeRRsig();
- EXPECT_EQ(0, rrset_a->getSIGRdataCount());
+ EXPECT_EQ(0, rrset_a->getRRsigDataCount());
}
}
More information about the bind10-changes
mailing list