Commit 3563065b authored by Mukund Sivaraman's avatar Mukund Sivaraman
Browse files

[2497] Add tests for RRSIG, SOA and SRV rrtypes

parent 41754f40
......@@ -101,6 +101,18 @@ TEST_F(Rdata_RRSIG_Test, DISABLED_badText) {
"8496isc.org. ofc="), InvalidRdataText);
}
TEST_F(Rdata_RRSIG_Test, createFromLexer) {
EXPECT_EQ(0, rdata_rrsig.compare(
*test::createRdataUsingLexer(RRType::RRSIG(), RRClass::IN(),
rrsig_txt)));
// Check that bad input throws as usual
EXPECT_THROW({
*test::createRdataUsingLexer(RRType::RRSIG(), RRClass::IN(),
"INVALIDINPUT");
}, InvalidRdataText);
}
TEST_F(Rdata_RRSIG_Test, toWireRenderer) {
// FIXME: This doesn't check the result.
rdata_rrsig.toWire(renderer);
......
......@@ -49,6 +49,13 @@ TEST_F(Rdata_SOA_Test, createFromWire) {
// TBD: more tests
}
TEST_F(Rdata_SOA_Test, createFromLexer) {
EXPECT_EQ(0, rdata_soa.compare(
*test::createRdataUsingLexer(RRType::SOA(), RRClass::IN(),
"ns.example.com. root.example.com. "
"2010012601 3600 300 3600000 1200")));
}
TEST_F(Rdata_SOA_Test, toWireRenderer) {
renderer.skip(2);
rdata_soa.toWire(renderer);
......
......@@ -119,6 +119,17 @@ TEST_F(Rdata_SRV_Test, createFromWire) {
"rdata_srv_fromWire", 89)));
}
TEST_F(Rdata_SRV_Test, createFromLexer) {
EXPECT_EQ(0, rdata_srv.compare(
*test::createRdataUsingLexer(RRType::SRV(), RRClass::IN(),
"1 5 1500 a.example.com.")));
// port is too large
EXPECT_THROW({
*test::createRdataUsingLexer(RRType::SRV(), RRClass::IN(),
"1 5 281474976710656 a.example.com.");
}, InvalidRdataText);
}
TEST_F(Rdata_SRV_Test, toWireBuffer) {
rdata_srv.toWire(obuffer);
EXPECT_PRED_FORMAT4(UnitTestUtil::matchWireData,
......
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