Browse Source

Merge branch 'trac2112'

Mukund Sivaraman 11 years ago
parent
commit
fb631319f3

+ 5 - 5
src/lib/datasrc/database.cc

@@ -103,7 +103,7 @@ DatabaseClient::findZone(const Name& name) const {
     }
     }
     // Then super domains
     // Then super domains
     // Start from 1, as 0 is covered above
     // Start from 1, as 0 is covered above
-    for (size_t i(1); i < name.getLabelCount(); ++i) {
+    for (size_t i = 1; i < name.getLabelCount(); ++i) {
         isc::dns::Name superdomain(name.split(i));
         isc::dns::Name superdomain(name.split(i));
         zone = accessor_->getZone(superdomain.toText());
         zone = accessor_->getZone(superdomain.toText());
         if (zone.first) {
         if (zone.first) {
@@ -344,7 +344,7 @@ DatabaseClient::Finder::getRRsets(const string& name, const WantedTypes& types,
     }
     }
     if (!sig_store.empty()) {
     if (!sig_store.empty()) {
         // Add signatures to all found RRsets
         // Add signatures to all found RRsets
-        for (std::map<RRType, RRsetPtr>::iterator i(result.begin());
+        for (std::map<RRType, RRsetPtr>::iterator i = result.begin();
              i != result.end(); ++ i) {
              i != result.end(); ++ i) {
             sig_store.appendSignatures(i->second);
             sig_store.appendSignatures(i->second);
         }
         }
@@ -760,7 +760,7 @@ DatabaseClient::Finder::FindDNSSECContext::probe() {
             const string origin = finder_.getOrigin().toText();
             const string origin = finder_.getOrigin().toText();
             const FoundRRsets nsec3_found =
             const FoundRRsets nsec3_found =
                 finder_.getRRsets(origin, NSEC3PARAM_TYPES(), true);
                 finder_.getRRsets(origin, NSEC3PARAM_TYPES(), true);
-            const FoundIterator nfi=
+            const FoundIterator nfi =
                 nsec3_found.second.find(RRType::NSEC3PARAM());
                 nsec3_found.second.find(RRType::NSEC3PARAM());
             is_nsec3_ = (nfi != nsec3_found.second.end());
             is_nsec3_ = (nfi != nsec3_found.second.end());
 
 
@@ -908,7 +908,7 @@ DatabaseClient::Finder::findOnNameResult(const Name& name,
         if (any) {
         if (any) {
             // An ANY query, copy everything to the target instead of returning
             // An ANY query, copy everything to the target instead of returning
             // directly.
             // directly.
-            for (FoundIterator it(found.second.begin());
+            for (FoundIterator it = found.second.begin();
                  it != found.second.end(); ++it) {
                  it != found.second.end(); ++it) {
                 if (it->second) {
                 if (it->second) {
                     // Skip over the empty ANY
                     // Skip over the empty ANY
@@ -1110,7 +1110,7 @@ DatabaseClient::Finder::findNSEC3(const Name& name, bool recursive) {
 
 
     // We keep stripping the leftmost label until we find something.
     // We keep stripping the leftmost label until we find something.
     // In case it is recursive, we'll exit the loop at the first iteration.
     // In case it is recursive, we'll exit the loop at the first iteration.
-    for (unsigned labels(qlabels); labels >= olabels; -- labels) {
+    for (unsigned labels = qlabels; labels >= olabels; --labels) {
         const string hash(calculator->calculate(labels == qlabels ? name :
         const string hash(calculator->calculate(labels == qlabels ? name :
                                                 name.split(qlabels - labels,
                                                 name.split(qlabels - labels,
                                                            labels)));
                                                            labels)));

+ 7 - 7
src/lib/datasrc/tests/client_list_unittest.cc

@@ -142,7 +142,7 @@ public:
             "                \"noiter.org\", \"null.org\"]"
             "                \"noiter.org\", \"null.org\"]"
             "}]"))
             "}]"))
     {
     {
-        for (size_t i(0); i < ds_count; ++ i) {
+        for (size_t i = 0; i < ds_count; ++ i) {
             boost::shared_ptr<MockDataSourceClient>
             boost::shared_ptr<MockDataSourceClient>
                 ds(new MockDataSourceClient(ds_zones[i]));
                 ds(new MockDataSourceClient(ds_zones[i]));
             ds_.push_back(ds);
             ds_.push_back(ds);
@@ -155,12 +155,12 @@ public:
 
 
     ~ListTest() {
     ~ListTest() {
         ds_info_.clear();
         ds_info_.clear();
-        for (size_t i(0); i < ds_count; ++ i) {
+        for (size_t i = 0; i < ds_count; ++ i) {
             ds_[i].reset();
             ds_[i].reset();
         }
         }
         ds_.clear();
         ds_.clear();
 
 
-        for (size_t i(0); i < ds_count; ++ i) {
+        for (size_t i = 0; i < ds_count; ++ i) {
             boost::interprocess::file_mapping::remove(
             boost::interprocess::file_mapping::remove(
                 getMappedFilename(i).c_str());
                 getMappedFilename(i).c_str());
         }
         }
@@ -465,7 +465,7 @@ const char* const test_names[] = {
 
 
 TEST_P(ListTest, multiExactMatch) {
 TEST_P(ListTest, multiExactMatch) {
     // Run through all the multi-configurations
     // Run through all the multi-configurations
-    for (size_t i(0); i < sizeof(test_names) / sizeof(*test_names); ++i) {
+    for (size_t i = 0; i < sizeof(test_names) / sizeof(*test_names); ++i) {
         SCOPED_TRACE(test_names[i]);
         SCOPED_TRACE(test_names[i]);
         multiConfiguration(i);
         multiConfiguration(i);
         // Something that is nowhere there
         // Something that is nowhere there
@@ -484,7 +484,7 @@ TEST_P(ListTest, multiExactMatch) {
 
 
 TEST_P(ListTest, multiBestMatch) {
 TEST_P(ListTest, multiBestMatch) {
     // Run through all the multi-configurations
     // Run through all the multi-configurations
-    for (size_t i(0); i < 4; ++ i) {
+    for (size_t i = 0; i < 4; ++ i) {
         SCOPED_TRACE(test_names[i]);
         SCOPED_TRACE(test_names[i]);
         multiConfiguration(i);
         multiConfiguration(i);
         // Something that is nowhere there
         // Something that is nowhere there
@@ -545,7 +545,7 @@ TEST_P(ListTest, configureParams) {
         "{}",
         "{}",
         NULL
         NULL
     };
     };
-    for (const char** param(params); *param; ++param) {
+    for (const char** param = params; *param; ++param) {
         SCOPED_TRACE(*param);
         SCOPED_TRACE(*param);
         ConstElementPtr elem(Element::fromJSON(string("["
         ConstElementPtr elem(Element::fromJSON(string("["
             "{"
             "{"
@@ -672,7 +672,7 @@ TEST_P(ListTest, wrongConfig) {
     // Put something inside to see it survives the exception
     // Put something inside to see it survives the exception
     list_->configure(config_elem_, true);
     list_->configure(config_elem_, true);
     checkDS(0, "test_type", "{}", false);
     checkDS(0, "test_type", "{}", false);
-    for (const char** config(configs); *config; ++config) {
+    for (const char** config = configs; *config; ++config) {
         SCOPED_TRACE(*config);
         SCOPED_TRACE(*config);
         ConstElementPtr elem(Element::fromJSON(*config));
         ConstElementPtr elem(Element::fromJSON(*config));
         EXPECT_THROW(list_->configure(elem, true),
         EXPECT_THROW(list_->configure(elem, true),

+ 4 - 4
src/lib/datasrc/tests/database_unittest.cc

@@ -293,7 +293,7 @@ private:
             if (position_ == domain_.end()) {
             if (position_ == domain_.end()) {
                 return (false);
                 return (false);
             } else {
             } else {
-                for (size_t i(0); i < COLUMN_COUNT; ++ i) {
+                for (size_t i = 0; i < COLUMN_COUNT; ++i) {
                     columns[i] = (*position_)[i];
                     columns[i] = (*position_)[i];
                 }
                 }
                 ++ position_;
                 ++ position_;
@@ -1814,7 +1814,7 @@ doFindAllTestResult(ZoneFinder& finder, const isc::dns::Name& name,
     std::sort(rdata.begin(), rdata.end());
     std::sort(rdata.begin(), rdata.end());
     std::sort(expected_rdata.begin(), expected_rdata.end());
     std::sort(expected_rdata.begin(), expected_rdata.end());
     ASSERT_EQ(expected_rdata.size(), rdata.size());
     ASSERT_EQ(expected_rdata.size(), rdata.size());
-    for (size_t i(0); i < expected_rdata.size(); ++ i) {
+    for (size_t i = 0; i < expected_rdata.size(); ++i) {
         EXPECT_EQ(expected_rdata[i], rdata[i]);
         EXPECT_EQ(expected_rdata[i], rdata[i]);
     }
     }
     EXPECT_TRUE(expected_rdata == rdata);
     EXPECT_TRUE(expected_rdata == rdata);
@@ -3023,7 +3023,7 @@ TEST_P(DatabaseClientTest, findRRSIGsWithoutDNSSEC) {
     std::sort(rdata.begin(), rdata.end());
     std::sort(rdata.begin(), rdata.end());
     std::sort(expected_rdata.begin(), expected_rdata.end());
     std::sort(expected_rdata.begin(), expected_rdata.end());
     ASSERT_EQ(expected_rdata.size(), rdata.size());
     ASSERT_EQ(expected_rdata.size(), rdata.size());
-    for (size_t i(0); i < expected_rdata.size(); ++ i) {
+    for (size_t i = 0; i < expected_rdata.size(); ++i) {
         EXPECT_EQ(expected_rdata[i], rdata[i]);
         EXPECT_EQ(expected_rdata[i], rdata[i]);
     }
     }
 }
 }
@@ -3065,7 +3065,7 @@ TEST_P(DatabaseClientTest, getAll) {
     EXPECT_EQ(RRType::A(), target[a_idx]->getType());
     EXPECT_EQ(RRType::A(), target[a_idx]->getType());
     std::string previous;
     std::string previous;
     size_t count(0);
     size_t count(0);
-    for (RdataIteratorPtr it(target[a_idx]->getRdataIterator());
+    for (RdataIteratorPtr it = target[a_idx]->getRdataIterator();
          !it->isLast(); it->next()) {
          !it->isLast(); it->next()) {
         ++count;
         ++count;
         EXPECT_NE(previous, it->getCurrent().toText());
         EXPECT_NE(previous, it->getCurrent().toText());

+ 1 - 1
src/lib/datasrc/tests/master_loader_callbacks_test.cc

@@ -52,7 +52,7 @@ public:
                                                          rrset.getTTL()));
                                                          rrset.getTTL()));
         EXPECT_FALSE(rrset.getRRsig()) << "Unexpected RRSIG on rrset, not "
         EXPECT_FALSE(rrset.getRRsig()) << "Unexpected RRSIG on rrset, not "
             "copying. Following check will likely fail as a result.";
             "copying. Following check will likely fail as a result.";
-        for (isc::dns::RdataIteratorPtr it(rrset.getRdataIterator());
+        for (isc::dns::RdataIteratorPtr it = rrset.getRdataIterator();
              !it->isLast(); it->next()) {
              !it->isLast(); it->next()) {
             copy->addRdata(it->getCurrent());
             copy->addRdata(it->getCurrent());
         }
         }

+ 1 - 1
src/lib/datasrc/tests/memory/domaintree_unittest.cc

@@ -1253,7 +1253,7 @@ previousWalk(TestDomainTree& dtree, const TestDomainTreeNode* node,
         EXPECT_EQ(static_cast<void*>(NULL), node);
         EXPECT_EQ(static_cast<void*>(NULL), node);
         node = dtree.previousNode(node_path);
         node = dtree.previousNode(node_path);
     }
     }
-    for (size_t i(chain_length); i > 0; --i) {
+    for (size_t i = chain_length; i > 0; --i) {
         EXPECT_NE(static_cast<void*>(NULL), node);
         EXPECT_NE(static_cast<void*>(NULL), node);
         EXPECT_EQ(Name(ordered_names[i - 1]), node_path.getAbsoluteName());
         EXPECT_EQ(Name(ordered_names[i - 1]), node_path.getAbsoluteName());
         // Find the node at the path and check the value is the same
         // Find the node at the path and check the value is the same

+ 2 - 2
src/lib/datasrc/tests/mock_client.cc

@@ -128,7 +128,7 @@ private:
 MockDataSourceClient::MockDataSourceClient(const char* zone_names[]) :
 MockDataSourceClient::MockDataSourceClient(const char* zone_names[]) :
     have_a_(true), use_baditerator_(true)
     have_a_(true), use_baditerator_(true)
 {
 {
-    for (const char** zone(zone_names); *zone; ++zone) {
+    for (const char** zone = zone_names; *zone; ++zone) {
         zones.insert(Name(*zone));
         zones.insert(Name(*zone));
     }
     }
 }
 }
@@ -145,7 +145,7 @@ MockDataSourceClient::MockDataSourceClient(
     EXPECT_NE("MasterFiles", type) << "MasterFiles is a special case "
     EXPECT_NE("MasterFiles", type) << "MasterFiles is a special case "
         "and it never should be created as a data source client";
         "and it never should be created as a data source client";
     if (configuration_->getType() == data::Element::list) {
     if (configuration_->getType() == data::Element::list) {
-        for (size_t i(0); i < configuration_->size(); ++i) {
+        for (size_t i = 0; i < configuration_->size(); ++i) {
             zones.insert(Name(configuration_->get(i)->stringValue()));
             zones.insert(Name(configuration_->get(i)->stringValue()));
         }
         }
     }
     }

+ 1 - 1
src/lib/datasrc/zone_finder.cc

@@ -130,7 +130,7 @@ ZoneFinder::stripRRsigs(isc::dns::ConstRRsetPtr rp,
                                      rp->getClass(),
                                      rp->getClass(),
                                      rp->getType(),
                                      rp->getType(),
                                      rp->getTTL()));
                                      rp->getTTL()));
-            for (isc::dns::RdataIteratorPtr i(rp->getRdataIterator());
+            for (isc::dns::RdataIteratorPtr i = rp->getRdataIterator();
                  !i->isLast();
                  !i->isLast();
                  i->next()) {
                  i->next()) {
                 result_base->addRdata(i->getCurrent());
                 result_base->addRdata(i->getCurrent());