Commit 271e37c6 authored by Mukund Sivaraman's avatar Mukund Sivaraman
Browse files

[2656] Check that origin argument is used for relative names

parent f59c311c
......@@ -96,6 +96,13 @@ TEST_F(Rdata_CNAME_Test, createFromLexer) {
EXPECT_EQ(0, rdata_cname.compare(
*test::createRdataUsingLexer(RRType::CNAME(), RRClass::IN(),
"cn.example.com.")));
// test::createRdataUsingLexer() constructs relative to
// "example.org." origin.
EXPECT_EQ(0, generic::CNAME("cname10.example.org.").compare(
*test::createRdataUsingLexer(RRType::CNAME(), RRClass::IN(),
"cname10")));
// Extra text at end of line
EXPECT_FALSE(test::createRdataUsingLexer(RRType::CNAME(), RRClass::IN(),
"cname.example.com. extra."));
......
......@@ -98,6 +98,13 @@ TEST_F(Rdata_DNAME_Test, createFromLexer) {
EXPECT_EQ(0, rdata_dname.compare(
*test::createRdataUsingLexer(RRType::DNAME(), RRClass::IN(),
"dn.example.com.")));
// test::createRdataUsingLexer() constructs relative to
// "example.org." origin.
EXPECT_EQ(0, generic::DNAME("dname8.example.org.").compare(
*test::createRdataUsingLexer(RRType::DNAME(), RRClass::IN(),
"dname8")));
// Extra text at end of line
EXPECT_FALSE(test::createRdataUsingLexer(RRType::DNAME(), RRClass::IN(),
"dname.example.com. extra."));
......
......@@ -126,6 +126,12 @@ TEST_F(Rdata_SRV_Test, createFromLexer) {
*test::createRdataUsingLexer(RRType::SRV(), RRClass::IN(),
"1 5 1500 a.example.com.")));
// test::createRdataUsingLexer() constructs relative to
// "example.org." origin.
EXPECT_EQ(0, in::SRV("1 5 1500 server16.example.org.").compare(
*test::createRdataUsingLexer(RRType::SRV(), RRClass::IN(),
"1 5 1500 server16")));
// Exceptions cause NULL to be returned.
// Bad priority
......
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