]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[2377] Fix test and check error
authorMichal 'vorner' Vaner <michal.vaner@nic.cz>
Mon, 3 Dec 2012 10:13:38 +0000 (11:13 +0100)
committerMichal 'vorner' Vaner <michal.vaner@nic.cz>
Mon, 3 Dec 2012 10:22:43 +0000 (11:22 +0100)
It seemed the wrong pushSource was used due to some automatic
conversion. Also, it complained it couldn't find the file, because a
slash was missing (and nobody noticed before).

src/lib/dns/master_loader.cc
src/lib/dns/tests/master_loader_unittest.cc

index 4444afa37754b915bfc1c71c0e8714236c2ecd34..e9aad9267ae5c196924fbdd2b7a220ed2db9bbdf 100644 (file)
@@ -41,7 +41,11 @@ public:
         add_callback_(add_callback),
         options_(options)
     {
-        lexer_.pushSource(master_file);
+        string errors;
+        if (!lexer_.pushSource(master_file, &errors)) {
+            // TODO: Handle somehow.
+            assert(0);
+        }
     }
 
     // Get a string token. Handle it as error if it is not string.
index 688410ba7bcdd5253f851411a427bfb4122509c4..d0a33393665442c8eaffe2dd4b67f1c0e69b72d9 100644 (file)
@@ -62,7 +62,7 @@ public:
     void setLoader(const char* file, const Name& origin, const RRClass rrclass,
                    const MasterLoader::Options options)
     {
-        loader_.reset(new MasterLoader((string(TEST_DATA_SRCDIR) +
+        loader_.reset(new MasterLoader((string(TEST_DATA_SRCDIR "/") +
                                         file).c_str(), origin, rrclass,
                                        callbacks_,
                                        boost::bind(&MasterLoaderTest::addRRset,
@@ -104,6 +104,6 @@ TEST_F(MasterLoaderTest, basicLoad) {
 
     checkRR("example.org", RRType::SOA(), "ns1.example.org. admin.example.org. "
             "1234 3600 1800 2419200 7200");
-    checkRR("example.org", RRType::NS(), "ns1.example.org");
+    checkRR("example.org", RRType::NS(), "ns1.example.org.");
     checkRR("www.example.org", RRType::A(), "192.0.2.1");
 }