Commit a9a6007e authored by Mukund Sivaraman's avatar Mukund Sivaraman Committed by JINMEI Tatuya
Browse files

[2497] Add tests for NSEC3PARAM, DS-like and TXT-like rrtypes

parent 3e964a48
......@@ -85,6 +85,18 @@ TYPED_TEST(Rdata_DS_LIKE_Test, createFromWire_DS_LIKE) {
"rdata_ds_fromWire")));
}
TYPED_TEST(Rdata_DS_LIKE_Test, createFromLexer_DS_LIKE) {
EXPECT_EQ(0, this->rdata_ds_like.compare(
*test::createRdataUsingLexer(RRTYPE<TypeParam>(), RRClass::IN(),
ds_like_txt)));
// Check that bad input throws as usual
EXPECT_THROW({
*test::createRdataUsingLexer(RRTYPE<TypeParam>(), RRClass::IN(),
"99999 5 2 BEEF");
}, InvalidRdataText);
}
TYPED_TEST(Rdata_DS_LIKE_Test, assignment_DS_LIKE) {
TypeParam copy((string(ds_like_txt)));
copy = this->rdata_ds_like;
......
......@@ -86,6 +86,13 @@ TEST_F(Rdata_NSEC3PARAM_Test, createFromWire) {
}
}
TEST_F(Rdata_NSEC3PARAM_Test, createFromLexer) {
const generic::NSEC3PARAM rdata_nsec3param(nsec3param_txt);
EXPECT_EQ(0, rdata_nsec3param.compare(
*test::createRdataUsingLexer(RRType::NSEC3PARAM(), RRClass::IN(),
nsec3param_txt)));
}
TEST_F(Rdata_NSEC3PARAM_Test, toWireRenderer) {
renderer.skip(2);
const generic::NSEC3PARAM rdata_nsec3param(nsec3param_txt);
......
......@@ -185,6 +185,18 @@ TYPED_TEST(Rdata_TXT_LIKE_Test, createFromWire) {
DNSMessageFORMERR);
}
TYPED_TEST(Rdata_TXT_LIKE_Test, createFromLexer) {
EXPECT_EQ(0, this->rdata_txt_like.compare(
*test::createRdataUsingLexer(RRTYPE<TypeParam>(), RRClass::IN(),
"Test String")));
EXPECT_EQ(0, this->rdata_txt_like_empty.compare(
*test::createRdataUsingLexer(RRTYPE<TypeParam>(), RRClass::IN(),
"")));
EXPECT_EQ(0, this->rdata_txt_like_quoted.compare(
*test::createRdataUsingLexer(RRTYPE<TypeParam>(), RRClass::IN(),
"\"Test String\"")));
}
TYPED_TEST(Rdata_TXT_LIKE_Test, toWireBuffer) {
this->rdata_txt_like.toWire(this->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