Commit 1c4683dd authored by Mukund Sivaraman's avatar Mukund Sivaraman
Browse files

[2497] Add tests for AFSDB, DHCID and DNSKEY rrtypes

parent 25f65134
......@@ -114,6 +114,18 @@ TEST_F(Rdata_AFSDB_Test, createFromWire) {
DNSMessageFORMERR);
}
TEST_F(Rdata_AFSDB_Test, createFromLexer) {
EXPECT_EQ(0, rdata_afsdb.compare(
*test::createRdataUsingLexer(RRType::AFSDB(), RRClass::IN(),
afsdb_text)));
// Check that bad input throws as usual
EXPECT_THROW({
*test::createRdataUsingLexer(RRType::AFSDB(), RRClass::IN(),
"1root.example.com.");
}, InvalidRdataText);
}
TEST_F(Rdata_AFSDB_Test, toWireBuffer) {
// construct actual data
rdata_afsdb.toWire(obuffer);
......
......@@ -63,6 +63,17 @@ TEST_F(Rdata_DHCID_Test, createFromWire) {
// TBD: more tests
}
TEST_F(Rdata_DHCID_Test, createFromLexer) {
EXPECT_EQ(0, rdata_dhcid.compare(
*test::createRdataUsingLexer(RRType::DHCID(), RRClass::IN(),
string_dhcid)));
// Check that bad input throws as usual
EXPECT_THROW({
*test::createRdataUsingLexer(RRType::DHCID(), RRClass::IN(), "00");
}, isc::BadValue);
}
TEST_F(Rdata_DHCID_Test, toWireRenderer) {
rdata_dhcid.toWire(renderer);
......
......@@ -82,6 +82,19 @@ TEST_F(Rdata_DNSKEY_Test, DISABLED_badText) {
InvalidRdataText);
}
TEST_F(Rdata_DNSKEY_Test, createFromLexer) {
generic::DNSKEY rdata_dnskey(dnskey_txt);
EXPECT_EQ(0, rdata_dnskey.compare(
*test::createRdataUsingLexer(RRType::DNSKEY(), RRClass::IN(),
dnskey_txt)));
// Check that bad input throws as usual
EXPECT_THROW({
*test::createRdataUsingLexer(RRType::DNSKEY(), RRClass::IN(),
"257 3 5");
}, InvalidRdataText);
}
TEST_F(Rdata_DNSKEY_Test, toWireRenderer) {
renderer.skip(2);
generic::DNSKEY rdata_dnskey(dnskey_txt);
......
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