|
@@ -357,16 +357,30 @@ TEST_F(SQLite3AccessorTest, findPrevious) {
|
|
|
// A name that doesn't exist
|
|
|
EXPECT_EQ("dns01.example.com.",
|
|
|
accessor->findPreviousName(1, "com.example.dns01x."));
|
|
|
+ // Largest name
|
|
|
+ EXPECT_EQ("www.example.com.",
|
|
|
+ accessor->findPreviousName(1, "com.example.wwww"));
|
|
|
// Wrap around
|
|
|
EXPECT_EQ("www.example.com.",
|
|
|
accessor->findPreviousName(1, "com.example."));
|
|
|
+ // Out of zone before and after
|
|
|
+ EXPECT_EQ("www.example.com.",
|
|
|
+ accessor->findPreviousName(1, "bb.example."));
|
|
|
+ EXPECT_EQ("www.example.com.",
|
|
|
+ accessor->findPreviousName(1, "org.example."));
|
|
|
+ // Case insensitive?
|
|
|
+ EXPECT_EQ("dns01.example.com.",
|
|
|
+ accessor->findPreviousName(1, "com.exaMple.DNS02."));
|
|
|
+ // A name that doesn't exist
|
|
|
+ EXPECT_EQ("dns01.example.com.",
|
|
|
+ accessor->findPreviousName(1, "com.exaMple.DNS01X."));
|
|
|
}
|
|
|
|
|
|
TEST_F(SQLite3AccessorTest, findPreviousNoData) {
|
|
|
// This one doesn't hold any NSEC records, so it shouldn't work
|
|
|
// The underlying DB/data don't support DNSSEC, so it's not implemented
|
|
|
// (does it make sense? Or different exception here?)
|
|
|
- EXPECT_THROW(accessor->findPreviousName(3, "com.example."),
|
|
|
+ EXPECT_THROW(accessor->findPreviousName(3, "com.example.sql2.www."),
|
|
|
isc::NotImplemented);
|
|
|
}
|
|
|
|