Commit 814eb8ad authored by Mukund Sivaraman's avatar Mukund Sivaraman
Browse files

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

parent 11f5ae7c
......@@ -73,6 +73,12 @@ TEST_F(Rdata_MX_Test, createFromLexer) {
*test::createRdataUsingLexer(RRType::MX(), RRClass::IN(),
"10 mx.example.com.")));
// test::createRdataUsingLexer() constructs relative to
// "example.org." origin.
EXPECT_EQ(0, generic::MX("10 mx2.example.org.").compare(
*test::createRdataUsingLexer(RRType::MX(), RRClass::IN(),
"10 mx2")));
// Exceptions cause NULL to be returned.
EXPECT_FALSE(test::createRdataUsingLexer(RRType::MX(), RRClass::IN(),
"10 mx. example.com."));
......
......@@ -96,6 +96,12 @@ TEST_F(Rdata_NS_Test, createFromLexer) {
*test::createRdataUsingLexer(RRType::NS(), RRClass::IN(),
"ns.example.com.")));
// test::createRdataUsingLexer() constructs relative to
// "example.org." origin.
EXPECT_EQ(0, generic::NS("ns8.example.org.").compare(
*test::createRdataUsingLexer(RRType::NS(), RRClass::IN(),
"ns8")));
// Exceptions cause NULL to be returned.
EXPECT_FALSE(test::createRdataUsingLexer(RRType::NS(), RRClass::IN(),
""));
......
......@@ -99,6 +99,13 @@ TEST_F(Rdata_PTR_Test, createFromLexer) {
EXPECT_EQ(0, rdata_ptr.compare(
*test::createRdataUsingLexer(RRType::PTR(), RRClass::IN(),
"ns.example.com.")));
// test::createRdataUsingLexer() constructs relative to
// "example.org." origin.
EXPECT_EQ(0, generic::PTR("foo0.example.org.").compare(
*test::createRdataUsingLexer(RRType::PTR(), RRClass::IN(),
"foo0")));
// Extra text at end of line
EXPECT_FALSE(test::createRdataUsingLexer(RRType::PTR(), RRClass::IN(),
"foo.example.com. extra."));
......
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