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
25f65134
Commit
25f65134
authored
Nov 30, 2012
by
Mukund Sivaraman
Browse files
[2497] Add tests for HINFO, MINFO and NAPTR rrtypes
parent
5c8cd401
Changes
3
Show whitespace changes
Inline
Side-by-side
src/lib/dns/tests/rdata_hinfo_unittest.cc
View file @
25f65134
...
@@ -77,6 +77,19 @@ TEST_F(Rdata_HINFO_Test, createFromWire) {
...
@@ -77,6 +77,19 @@ TEST_F(Rdata_HINFO_Test, createFromWire) {
EXPECT_EQ
(
string
(
"Linux"
),
hinfo
.
getOS
());
EXPECT_EQ
(
string
(
"Linux"
),
hinfo
.
getOS
());
}
}
TEST_F
(
Rdata_HINFO_Test
,
createFromLexer
)
{
HINFO
rdata_hinfo
(
hinfo_str
);
EXPECT_EQ
(
0
,
rdata_hinfo
.
compare
(
*
test
::
createRdataUsingLexer
(
RRType
::
HINFO
(),
RRClass
::
IN
(),
hinfo_str
)));
// Check that bad input throws as usual
EXPECT_THROW
({
*
test
::
createRdataUsingLexer
(
RRType
::
HINFO
(),
RRClass
::
IN
(),
"
\"
Pentium
\"\"
Linux
\"
"
);
},
InvalidRdataText
);
}
TEST_F
(
Rdata_HINFO_Test
,
toText
)
{
TEST_F
(
Rdata_HINFO_Test
,
toText
)
{
HINFO
hinfo
(
hinfo_str
);
HINFO
hinfo
(
hinfo_str
);
EXPECT_EQ
(
hinfo_str
,
hinfo
.
toText
());
EXPECT_EQ
(
hinfo_str
,
hinfo
.
toText
());
...
...
src/lib/dns/tests/rdata_minfo_unittest.cc
View file @
25f65134
...
@@ -103,6 +103,12 @@ TEST_F(Rdata_MINFO_Test, createFromWire) {
...
@@ -103,6 +103,12 @@ TEST_F(Rdata_MINFO_Test, createFromWire) {
DNSMessageFORMERR
);
DNSMessageFORMERR
);
}
}
TEST_F
(
Rdata_MINFO_Test
,
createFromLexer
)
{
EXPECT_EQ
(
0
,
rdata_minfo
.
compare
(
*
test
::
createRdataUsingLexer
(
RRType
::
MINFO
(),
RRClass
::
IN
(),
minfo_txt
)));
}
TEST_F
(
Rdata_MINFO_Test
,
assignment
)
{
TEST_F
(
Rdata_MINFO_Test
,
assignment
)
{
generic
::
MINFO
copy
((
string
(
minfo_txt2
)));
generic
::
MINFO
copy
((
string
(
minfo_txt2
)));
copy
=
rdata_minfo
;
copy
=
rdata_minfo
;
...
...
src/lib/dns/tests/rdata_naptr_unittest.cc
View file @
25f65134
...
@@ -128,6 +128,21 @@ TEST_F(Rdata_NAPTR_Test, createFromWire) {
...
@@ -128,6 +128,21 @@ TEST_F(Rdata_NAPTR_Test, createFromWire) {
EXPECT_EQ
(
Name
(
"_sip._udp.example.com."
),
naptr
.
getReplacement
());
EXPECT_EQ
(
Name
(
"_sip._udp.example.com."
),
naptr
.
getReplacement
());
}
}
TEST_F
(
Rdata_NAPTR_Test
,
createFromLexer
)
{
NAPTR
rdata_naptr
(
naptr_str
);
EXPECT_EQ
(
0
,
rdata_naptr
.
compare
(
*
test
::
createRdataUsingLexer
(
RRType
::
NAPTR
(),
RRClass
::
IN
(),
naptr_str
)));
// Check that bad input throws as usual (order > 65535)
EXPECT_THROW
({
*
test
::
createRdataUsingLexer
(
RRType
::
NAPTR
(),
RRClass
::
IN
(),
"65536 10 S SIP
\"\"
"
"_sip._udp.example.com."
);
},
InvalidRdataText
);
}
TEST_F
(
Rdata_NAPTR_Test
,
toWire
)
{
TEST_F
(
Rdata_NAPTR_Test
,
toWire
)
{
NAPTR
naptr
(
naptr_str
);
NAPTR
naptr
(
naptr_str
);
naptr
.
toWire
(
obuffer
);
naptr
.
toWire
(
obuffer
);
...
...
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