Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISC Open Source Projects
Kea
Commits
b26f6251
Commit
b26f6251
authored
Jan 28, 2014
by
Mukund Sivaraman
Browse files
Merge branch 'trac3263_2'
parents
c9505d8f
5519de5b
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/lib/dns/rrset.h
View file @
b26f6251
...
...
@@ -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
;
...
...
src/lib/dns/tests/rrset_unittest.cc
View file @
b26f6251
...
...
@@ -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
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment