Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
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
5c8cd401
Commit
5c8cd401
authored
Nov 30, 2012
by
Mukund Sivaraman
Browse files
[2497] Add tests for OPT, PTR and RP rrtypes
parent
3563065b
Changes
3
Show whitespace changes
Inline
Side-by-side
src/lib/dns/tests/rdata_opt_unittest.cc
View file @
5c8cd401
...
@@ -56,6 +56,14 @@ TEST_F(Rdata_OPT_Test, createFromWire) {
...
@@ -56,6 +56,14 @@ TEST_F(Rdata_OPT_Test, createFromWire) {
InvalidRdataLength
);
InvalidRdataLength
);
}
}
TEST_F
(
Rdata_OPT_Test
,
createFromLexer
)
{
// OPT RR cannot be created from text.
EXPECT_THROW
({
*
test
::
createRdataUsingLexer
(
RRType
::
OPT
(),
RRClass
::
IN
(),
"this does not matter"
);
},
InvalidRdataText
);
}
TEST_F
(
Rdata_OPT_Test
,
toWireBuffer
)
{
TEST_F
(
Rdata_OPT_Test
,
toWireBuffer
)
{
rdata_opt
.
toWire
(
obuffer
);
rdata_opt
.
toWire
(
obuffer
);
EXPECT_EQ
(
0
,
obuffer
.
getLength
());
EXPECT_EQ
(
0
,
obuffer
.
getLength
());
...
...
src/lib/dns/tests/rdata_ptr_unittest.cc
View file @
5c8cd401
...
@@ -90,6 +90,12 @@ TEST_F(Rdata_PTR_Test, createFromWire) {
...
@@ -90,6 +90,12 @@ TEST_F(Rdata_PTR_Test, createFromWire) {
InvalidRdataLength
);
InvalidRdataLength
);
}
}
TEST_F
(
Rdata_PTR_Test
,
createFromLexer
)
{
EXPECT_EQ
(
0
,
rdata_ptr
.
compare
(
*
test
::
createRdataUsingLexer
(
RRType
::
PTR
(),
RRClass
::
IN
(),
"ns.example.com"
)));
}
TEST_F
(
Rdata_PTR_Test
,
toWireBuffer
)
{
TEST_F
(
Rdata_PTR_Test
,
toWireBuffer
)
{
rdata_ptr
.
toWire
(
obuffer
);
rdata_ptr
.
toWire
(
obuffer
);
EXPECT_PRED_FORMAT4
(
UnitTestUtil
::
matchWireData
,
EXPECT_PRED_FORMAT4
(
UnitTestUtil
::
matchWireData
,
...
...
src/lib/dns/tests/rdata_rp_unittest.cc
View file @
5c8cd401
...
@@ -106,6 +106,19 @@ TEST_F(Rdata_RP_Test, createFromParams) {
...
@@ -106,6 +106,19 @@ TEST_F(Rdata_RP_Test, createFromParams) {
EXPECT_EQ
(
text_name
,
generic
::
RP
(
mailbox_name
,
text_name
).
getText
());
EXPECT_EQ
(
text_name
,
generic
::
RP
(
mailbox_name
,
text_name
).
getText
());
}
}
TEST_F
(
Rdata_RP_Test
,
createFromLexer
)
{
EXPECT_EQ
(
0
,
rdata_rp
.
compare
(
*
test
::
createRdataUsingLexer
(
RRType
::
RP
(),
RRClass
::
IN
(),
"root.example.com. "
"rp-text.example.com."
)));
// Check that bad input throws as usual
EXPECT_THROW
({
*
test
::
createRdataUsingLexer
(
RRType
::
RP
(),
RRClass
::
IN
(),
"mailbox.example.com."
);
},
InvalidRdataText
);
}
TEST_F
(
Rdata_RP_Test
,
toWireBuffer
)
{
TEST_F
(
Rdata_RP_Test
,
toWireBuffer
)
{
// construct expected data
// construct expected data
UnitTestUtil
::
readWireData
(
"rdata_rp_toWire1.wire"
,
expected_wire
);
UnitTestUtil
::
readWireData
(
"rdata_rp_toWire1.wire"
,
expected_wire
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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