diff --git a/src/lib/dns/tests/rdata_ds_like_unittest.cc b/src/lib/dns/tests/rdata_ds_like_unittest.cc index 6172431d77..7838a34980 100644 --- a/src/lib/dns/tests/rdata_ds_like_unittest.cc +++ b/src/lib/dns/tests/rdata_ds_like_unittest.cc @@ -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(), RRClass::IN(), + ds_like_txt))); + + // Check that bad input throws as usual + EXPECT_THROW({ + *test::createRdataUsingLexer(RRTYPE(), 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; diff --git a/src/lib/dns/tests/rdata_nsec3param_unittest.cc b/src/lib/dns/tests/rdata_nsec3param_unittest.cc index 7558b42a74..115d3d3f31 100644 --- a/src/lib/dns/tests/rdata_nsec3param_unittest.cc +++ b/src/lib/dns/tests/rdata_nsec3param_unittest.cc @@ -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); diff --git a/src/lib/dns/tests/rdata_txt_like_unittest.cc b/src/lib/dns/tests/rdata_txt_like_unittest.cc index 981265e380..7ff9ac9a0d 100644 --- a/src/lib/dns/tests/rdata_txt_like_unittest.cc +++ b/src/lib/dns/tests/rdata_txt_like_unittest.cc @@ -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(), RRClass::IN(), + "Test String"))); + EXPECT_EQ(0, this->rdata_txt_like_empty.compare( + *test::createRdataUsingLexer(RRTYPE(), RRClass::IN(), + ""))); + EXPECT_EQ(0, this->rdata_txt_like_quoted.compare( + *test::createRdataUsingLexer(RRTYPE(), RRClass::IN(), + "\"Test String\""))); +} + TYPED_TEST(Rdata_TXT_LIKE_Test, toWireBuffer) { this->rdata_txt_like.toWire(this->obuffer); EXPECT_PRED_FORMAT4(UnitTestUtil::matchWireData,