2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-30 21:45:37 +00:00

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

This commit is contained in:
Mukund Sivaraman
2012-11-30 18:05:48 +05:30
parent e3afa9c528
commit 43292d60d9
3 changed files with 31 additions and 0 deletions

View File

@@ -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;

View File

@@ -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);

View File

@@ -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,