BIND 10 master, updated. b26f6251fc5956a22bfe5a63066cd3a1545af32d Merge branch 'trac3263_2'
BIND 10 source code commits
bind10-changes at lists.isc.org
Tue Jan 28 01:55:29 UTC 2014
The branch, master has been updated
via b26f6251fc5956a22bfe5a63066cd3a1545af32d (commit)
via 5519de5b8255213341664ff91d1dc0695de32f6d (commit)
via 32bd410bb036fb31420c2424af685c621cf834be (commit)
from c9505d8f35ffcd707421fd169704c1ac29aebcd0 (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 b26f6251fc5956a22bfe5a63066cd3a1545af32d
Merge: c9505d8 5519de5
Author: Mukund Sivaraman <muks at isc.org>
Date: Tue Jan 28 07:15:28 2014 +0530
Merge branch 'trac3263_2'
-----------------------------------------------------------------------
Summary of changes:
src/lib/dns/rrset.h | 7 +++++++
src/lib/dns/tests/rrset_unittest.cc | 12 ++++++++++--
2 files changed, 17 insertions(+), 2 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/lib/dns/rrset.h b/src/lib/dns/rrset.h
index eb8fa6e..e2301d6 100644
--- a/src/lib/dns/rrset.h
+++ b/src/lib/dns/rrset.h
@@ -376,6 +376,13 @@ public:
/// Still, this version would offer a more intuitive interface and is
/// provided as such.
///
+ /// NOTE: Because a new Rdata object is constructed, this method can
+ /// throw a std::bad_cast exception if this RRset's class is NONE,
+ /// or if some other error occurs. If you want to be able to add
+ /// RDATA to an RRset whose class is NONE, please use the other
+ /// variant of \c addRdata() which accepts a \c ConstRdataPtr
+ /// argument.
+ ///
/// \param rdata A reference to a \c rdata::RdataPtr (derived) class
/// object, a copy of which is to be added to the \c RRset.
virtual void addRdata(const rdata::Rdata& rdata) = 0;
diff --git a/src/lib/dns/tests/rrset_unittest.cc b/src/lib/dns/tests/rrset_unittest.cc
index da3eb52..3e140bd 100644
--- a/src/lib/dns/tests/rrset_unittest.cc
+++ b/src/lib/dns/tests/rrset_unittest.cc
@@ -157,14 +157,22 @@ TEST_F(RRsetTest, addRdataPtr) {
rrset_a_empty.addRdata(createRdata(rrset_a_empty.getType(),
rrset_a_empty.getClass(),
"192.0.2.2"));
-
addRdataTestCommon(rrset_a);
+}
+TEST_F(RRsetTest, addRdataPtrMismatched) {
// Pointer version of addRdata() doesn't type check and does allow to
//add a different type of Rdata as a result.
+
+ // Type mismatch
rrset_a_empty.addRdata(createRdata(RRType::NS(), RRClass::IN(),
"ns.example.com."));
- EXPECT_EQ(3, rrset_a_empty.getRdataCount());
+ EXPECT_EQ(1, rrset_a_empty.getRdataCount());
+
+ // Class mismatch
+ rrset_ch_txt.addRdata(createRdata(RRType::TXT(), RRClass::IN(),
+ "Test String"));
+ EXPECT_EQ(1, rrset_ch_txt.getRdataCount());
}
TEST_F(RRsetTest, iterator) {
More information about the bind10-changes
mailing list