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

[2427] More error handling tests for $ORIGIN

They all pass now, as the framework to handle them was already in place.
This is just to check it works well.
parent e47b08e8
......@@ -333,6 +333,10 @@ struct ErrorCase {
{ "$INCLUDE /file/not/found", "Include file not found" },
{ "$INCLUDE /file/not/found and here goes bunch of garbage",
"Include file not found and garbage at the end of line" },
{ "$ORIGIN", "Missing origin name" },
{ "$ORIGIN", "Invalid name for origin" },
{ "$ORIGI name.", "$ORIGIN too short" },
{ "$ORIGINAL name.", "$ORIGIN too long" },
......@@ -423,6 +427,22 @@ TEST_F(MasterLoaderTest, includeWithGarbage) {
checkRR("", RRType::AAAA(), "2001:db8::1");
// Check we error about garbage at the end of $ORIGIN line (but the line works).
TEST_F(MasterLoaderTest, originWithGarbage) {
const string origin_str = "$ORIGIN www More garbage here\n"
"@ 1H IN A\n";
stringstream ss(origin_str);
setLoader(ss, Name(""), RRClass::IN(),
ASSERT_EQ(1, errors_.size());
// It says something about extra tokens at the end
EXPECT_NE(string::npos, errors_[0].find("Extra"));
// Test the constructor rejects empty add callback.
TEST_F(MasterLoaderTest, emptyCallback) {
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