Browse Source

[1207] several small cleanups

Jelte Jansen 13 years ago
parent
commit
2a57f8bbd3

+ 2 - 1
src/bin/auth/auth_config.cc

@@ -145,7 +145,8 @@ MemoryDatasourceConfig::build(ConstElementPtr config_value) {
 
     // We'd eventually optimize building zones (in case of reloading) by
     // selectively loading fresh zones.  Right now we simply check the
-    // RR class is supported by the server implementation.
+    // RR class is supported by the server implementation, by calling
+    // the get (it should throw on the wrong class).
     (void)server_.getInMemoryClientContainer(rrclass_);
     memory_client_ = isc::datasrc::DataSourceClientContainerPtr(
         new isc::datasrc::DataSourceClientContainer("memory", config_value));

+ 0 - 1
src/bin/auth/auth_srv.cc

@@ -432,7 +432,6 @@ AuthSrv::setInMemoryClient(const isc::dns::RRClass& rrclass,
     impl_->memory_client_container_ = memory_client;
 }
 
-
 uint32_t
 AuthSrv::getStatisticsTimerInterval() const {
     return (impl_->statistics_timer_.getInterval() / 1000);

+ 1 - 1
src/bin/auth/auth_srv.h

@@ -286,7 +286,7 @@ public:
     ///
     /// If there is already an in memory data source configured, it will be
     /// replaced with the newly specified one.
-    /// \c memory_datasrc can be an empty shared pointer, in which case it
+    /// \c memory_client can be an empty shared pointer, in which case it
     /// will (re)disable the in-memory data source.
     ///
     /// \param rrclass The RR class of the in-memory data source to be set.

+ 3 - 4
src/bin/auth/tests/command_unittest.cc

@@ -247,7 +247,7 @@ TEST_F(AuthCommandTest, loadZone) {
                                     Element::fromJSON(
                                         "{\"origin\": \"test1.example\"}"));
     checkAnswer(0);
-    //newZoneChecks(server_);
+    newZoneChecks(server_);
 }
 
 // This test uses dynamic load of a data source module, and won't work when
@@ -295,7 +295,6 @@ TEST_F(AuthCommandTest,
 
     // The loadzone command needs the zone to be already loaded, because
     // it is used for reloading only
-    //AuthSrv::InMemoryClientPtr dsrc(new InMemoryClient());
     isc::datasrc::DataSourceClientContainerPtr dsrc(
         new isc::datasrc::DataSourceClientContainer("memory",
             Element::fromJSON("{\"type\": \"memory\"}")));
@@ -313,7 +312,7 @@ TEST_F(AuthCommandTest,
 
     // Get the zone and look if there are data in it (the original one was
     // empty)
-    ASSERT_TRUE(server_.getInMemoryClientContainer(RRClass::IN()));
+    ASSERT_TRUE(server_.hasInMemoryClient());
     EXPECT_EQ(ZoneFinder::SUCCESS, server_.getInMemoryClient(RRClass::IN())->
               findZone(Name("example.org")).zone_finder->
               find(Name("example.org"), RRType::SOA())->code);
@@ -377,7 +376,7 @@ TEST_F(AuthCommandTest,
     module_session.setLocalConfig(broken);
     checkAnswer(1);
     // The previous zone is not hurt in any way
-    EXPECT_EQ(ZoneFinder::SUCCESS, server_.getInMemoryClientContainer(RRClass::IN())->getInstance().
+    EXPECT_EQ(ZoneFinder::SUCCESS, server_.getInMemoryClient(RRClass::IN())->
               findZone(Name("example.org")).zone_finder->
               find(Name("example.org"), RRType::SOA())->code);
 }

+ 0 - 1
src/bin/auth/tests/config_unittest.cc

@@ -321,7 +321,6 @@ TEST_F(MemoryDatasrcConfigTest, exception) {
     // the given master file should not exist
     delete parser;
     parser = createAuthConfigParser(server, "datasources");
-
     EXPECT_THROW(parser->build(Element::fromJSON(
                       "[{\"type\": \"memory\","
                       "  \"zones\": [{\"origin\": \"example.org\","

+ 4 - 0
src/lib/datasrc/tests/client_unittest.cc

@@ -56,4 +56,8 @@ TEST_F(ClientTest, defaultIterator) {
     EXPECT_THROW(client_.getIterator(Name(".")), isc::NotImplemented);
 }
 
+TEST_F(ClientTest, defaultGetZoneCount) {
+    EXPECT_THROW(client_.getZoneCount(), isc::NotImplemented);
+}
+
 }