From: Mukund Sivaraman Date: Fri, 4 Jan 2013 12:34:34 +0000 (+0530) Subject: [2535] Split up createSQLite3Client method X-Git-Tag: bind10-1.0.0-rc-release~99^2~25^2~1^2~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a6ce7e4332223277ca50cd68a65e7e404621717c;p=thirdparty%2Fkea.git [2535] Split up createSQLite3Client method --- diff --git a/src/lib/datasrc/tests/zone_finder_context_unittest.cc b/src/lib/datasrc/tests/zone_finder_context_unittest.cc index 6844712c57..0e18a996a9 100644 --- a/src/lib/datasrc/tests/zone_finder_context_unittest.cc +++ b/src/lib/datasrc/tests/zone_finder_context_unittest.cc @@ -81,7 +81,7 @@ addRRset(ZoneUpdaterPtr updater, ConstRRsetPtr rrset) { } DataSourceClientPtr -createSQLite3Client(RRClass zclass, const Name& zname) { +createSQLite3Client(RRClass zclass, const Name& zname, stringstream& ss) { // We always begin with an empty template SQLite3 DB file and install // the zone data from the zone file to ensure both cases have the // same test data. @@ -93,7 +93,6 @@ createSQLite3Client(RRClass zclass, const Name& zname) { // Note that neither updater nor SQLite3 accessor checks this condition, // so this should succeed. ZoneUpdaterPtr updater = client->getUpdater(zname, false); - stringstream ss("ns.example.com. 3600 IN A 192.0.2.7"); masterLoad(ss, Name::ROOT_NAME(), zclass, boost::bind(addRRset, updater, _1)); updater->commit(); @@ -101,6 +100,12 @@ createSQLite3Client(RRClass zclass, const Name& zname) { return (client); } +DataSourceClientPtr +createSQLite3ClientWithNS(RRClass zclass, const Name& zname) { + stringstream ss("ns.example.com. 3600 IN A 192.0.2.7"); + return (createSQLite3Client(zclass, zname, ss)); +} + // The test class. Its parameterized so we can share the test scnearios // for any concrete data source implementaitons. class ZoneFinderContextTest : @@ -134,7 +139,7 @@ protected: // We test the in-memory and SQLite3 data source implementations. INSTANTIATE_TEST_CASE_P(, ZoneFinderContextTest, ::testing::Values(createInMemoryClient, - createSQLite3Client)); + createSQLite3ClientWithNS)); TEST_P(ZoneFinderContextTest, getAdditionalAuthNS) { ZoneFinderContextPtr ctx = finder_->find(qzone_, RRType::NS());