Commit a6cbb14c authored by Michal 'vorner' Vaner's avatar Michal 'vorner' Vaner
Browse files

[1177] More tests for SQLite3Accessor NSEC

parent 7cc32b79
......@@ -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);
}
......
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