Commit 7a8ebc83 authored by JINMEI Tatuya's avatar JINMEI Tatuya
Browse files

make sure the partial match is indeed the longest match by adding

a zone with a shorter origin and query again.
as suggested in review.

git-svn-id: svn://bind10.isc.org/svn/bind10/branches/trac399@3586 e5f2f494-b856-4b98-b285-d166d9295462
parent abd1f76d
...@@ -93,5 +93,12 @@ TEST_F(ZoneTableTest, find) { ...@@ -93,5 +93,12 @@ TEST_F(ZoneTableTest, find) {
zone_table.find(Name("www.example.com")).code); zone_table.find(Name("www.example.com")).code);
EXPECT_EQ(Name("example.com"), EXPECT_EQ(Name("example.com"),
zone_table.find(Name("www.example.com")).zone->getOrigin()); zone_table.find(Name("www.example.com")).zone->getOrigin());
// make sure the partial match is indeed the longest match by adding
// a zone with a shorter origin and query again.
ZonePtr zone_com(new Zone(RRClass::IN(), Name("com")));
EXPECT_EQ(ZoneTable::SUCCESS, zone_table.add(zone_com));
EXPECT_EQ(Name("example.com"),
zone_table.find(Name("www.example.com")).zone->getOrigin());
} }
} }
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