From: Michal 'vorner' Vaner Date: Mon, 3 Dec 2012 10:13:38 +0000 (+0100) Subject: [2377] Fix test and check error X-Git-Tag: bind10-1.0.0-beta-release~24^2~58 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c90033f1d91fd82c7bafbe645de95281c46ff46f;p=thirdparty%2Fkea.git [2377] Fix test and check error 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). --- diff --git a/src/lib/dns/master_loader.cc b/src/lib/dns/master_loader.cc index 4444afa377..e9aad9267a 100644 --- a/src/lib/dns/master_loader.cc +++ b/src/lib/dns/master_loader.cc @@ -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. diff --git a/src/lib/dns/tests/master_loader_unittest.cc b/src/lib/dns/tests/master_loader_unittest.cc index 688410ba7b..d0a3339366 100644 --- a/src/lib/dns/tests/master_loader_unittest.cc +++ b/src/lib/dns/tests/master_loader_unittest.cc @@ -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"); }