From c0f704fc0969565af020e1b51db5aaac63d68d52 Mon Sep 17 00:00:00 2001 From: JINMEI Tatuya Date: Wed, 21 Mar 2012 13:58:50 -0700 Subject: [PATCH] [1688] editorial fixes/cleanups: folded long line, naming convention, constify. also removed "addRRset" utility from rbnode_rrset_unittest, which seems to be a leftover from an intermediate version (and isn't used anyway) --- src/bin/auth/query.cc | 4 ++-- src/bin/auth/query.h | 2 +- src/bin/auth/tests/query_unittest.cc | 3 ++- src/lib/datasrc/tests/rbnode_rrset_unittest.cc | 12 ------------ 4 files changed, 5 insertions(+), 16 deletions(-) diff --git a/src/bin/auth/query.cc b/src/bin/auth/query.cc index a6a666256d..5a99b400cd 100644 --- a/src/bin/auth/query.cc +++ b/src/bin/auth/query.cc @@ -59,9 +59,9 @@ Query::RRsetInserter::addRRset(isc::dns::Message& message, const ConstRRsetPtr& rrset, const bool dnssec) { /// Is this RRset already in the list of RRsets added to the message? - std::vector::iterator i = + const std::vector::const_iterator i = std::find_if(added_.begin(), added_.end(), - std::bind1st(Query::RRsetInserter::isSameKind(), + std::bind1st(Query::RRsetInserter::IsSameKind(), rrset.get())); if (i == added_.end()) { // No - add it to both the message and the list of RRsets processed. diff --git a/src/bin/auth/query.h b/src/bin/auth/query.h index 44092d0832..4b68181f28 100644 --- a/src/bin/auth/query.h +++ b/src/bin/auth/query.h @@ -265,7 +265,7 @@ private: class RRsetInserter { public: // \brief RRset comparison functor. - struct isSameKind : public std::binary_function< + struct IsSameKind : public std::binary_function< const isc::dns::AbstractRRset*, const isc::dns::AbstractRRset*, bool> { diff --git a/src/bin/auth/tests/query_unittest.cc b/src/bin/auth/tests/query_unittest.cc index e40854337d..53edcf27c8 100644 --- a/src/bin/auth/tests/query_unittest.cc +++ b/src/bin/auth/tests/query_unittest.cc @@ -2430,7 +2430,8 @@ loadRRsetVector() { << cname_nxdom_txt // 7(1) << cname_out_txt; // 8(1) rrset_vector.clear(); - masterLoad(ss, Name("example.com."), RRClass::IN(), loadRRsetVectorCallback); + masterLoad(ss, Name("example.com."), RRClass::IN(), + loadRRsetVectorCallback); } TEST_F(QueryTest, DuplicateNameRemoval) { diff --git a/src/lib/datasrc/tests/rbnode_rrset_unittest.cc b/src/lib/datasrc/tests/rbnode_rrset_unittest.cc index d6fa32e049..0fb82bcdb1 100644 --- a/src/lib/datasrc/tests/rbnode_rrset_unittest.cc +++ b/src/lib/datasrc/tests/rbnode_rrset_unittest.cc @@ -157,18 +157,6 @@ TEST_F(RBNodeRRsetTest, isSameKind) { EXPECT_FALSE(rrset_p.isSameKind(rrset_z)); } - -// Utility function to create an add an RRset to a vector of RRsets for the -// "less" test. It's only purpose is to allow the RRset creation to be -// written with arguments in an order that reflects the RRset ordering. -void -addRRset(std::vector& vec, const RRType& rrtype, - const RRClass& rrclass, const char* rrname) -{ - vec.push_back(ConstRRsetPtr(new RRset(Name(rrname), rrclass, rrtype, - RRTTL(3600)))); -} - // Note: although the next two tests are essentially the same and used common // test code, they use different test data: the MessageRenderer produces // compressed wire data whereas the OutputBuffer does not.