BIND 10 trac2377, updated. 92ac412b79d7b8c9d802530b9019f4c918d6fdd8 [2377] Check we warn about EOF without EOLN

BIND 10 source code commits bind10-changes at lists.isc.org
Tue Dec 11 10:37:06 UTC 2012


The branch, trac2377 has been updated
       via  92ac412b79d7b8c9d802530b9019f4c918d6fdd8 (commit)
      from  7631aa8f7c4eeb998deabfdd60a9ee6eeb0d05dc (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 92ac412b79d7b8c9d802530b9019f4c918d6fdd8
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date:   Tue Dec 11 11:35:28 2012 +0100

    [2377] Check we warn about EOF without EOLN

-----------------------------------------------------------------------

Summary of changes:
 src/lib/dns/tests/master_loader_unittest.cc |   19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

-----------------------------------------------------------------------
diff --git a/src/lib/dns/tests/master_loader_unittest.cc b/src/lib/dns/tests/master_loader_unittest.cc
index 74baa3b..70e3249 100644
--- a/src/lib/dns/tests/master_loader_unittest.cc
+++ b/src/lib/dns/tests/master_loader_unittest.cc
@@ -319,4 +319,23 @@ TEST_F(MasterLoaderTest, loadZero) {
     EXPECT_THROW(loader_->loadIncremental(0), isc::InvalidParameter);
 }
 
+// Test there's a warning when the file terminates without end of
+// line.
+TEST_F(MasterLoaderTest, noEOLN) {
+    // No \n at the end
+    const string input("example.org. 3600 IN SOA ns1.example.org. "
+                       "admin.example.org. 1234 3600 1800 2419200 7200");
+    stringstream ss(input);
+    setLoader(ss, Name("example.org."), RRClass::IN(),
+              MasterLoader::MANY_ERRORS);
+
+    loader_->load();
+    EXPECT_TRUE(loader_->loadedSucessfully());
+    EXPECT_TRUE(errors_.empty()) << errors_[0];
+    // There should be one warning about the EOLN
+    EXPECT_EQ(1, warnings_.size());
+    checkRR("example.org", RRType::SOA(), "ns1.example.org. "
+            "admin.example.org. 1234 3600 1800 2419200 7200");
+}
+
 }



More information about the bind10-changes mailing list