Commit 25f65134 authored by Mukund Sivaraman's avatar Mukund Sivaraman
Browse files

[2497] Add tests for HINFO, MINFO and NAPTR rrtypes

parent 5c8cd401
......@@ -77,6 +77,19 @@ TEST_F(Rdata_HINFO_Test, createFromWire) {
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) {
HINFO hinfo(hinfo_str);
EXPECT_EQ(hinfo_str, hinfo.toText());
......
......@@ -103,6 +103,12 @@ TEST_F(Rdata_MINFO_Test, createFromWire) {
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) {
generic::MINFO copy((string(minfo_txt2)));
copy = rdata_minfo;
......
......@@ -128,6 +128,21 @@ TEST_F(Rdata_NAPTR_Test, createFromWire) {
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) {
NAPTR naptr(naptr_str);
naptr.toWire(obuffer);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment