BIND 10 trac2432, updated. e7f9ab53656fdfb8a1b27c7056f8dc2c86d8f966 [2432] Use prefix operator++
BIND 10 source code commits
bind10-changes at lists.isc.org
Mon Jan 7 09:05:19 UTC 2013
The branch, trac2432 has been updated
via e7f9ab53656fdfb8a1b27c7056f8dc2c86d8f966 (commit)
via 35d02013f29d19fabf678089ba97db2e67ab3f25 (commit)
via 004823862f69853d3c4acd6f8e0bc60925c25ed1 (commit)
via 1fa69473d881a5c31cd802563f2c398e1f6d1ecb (commit)
via 3baea8cf898f2e9dcd35c88e48999b8112732f9d (commit)
via 08c2f82000bacb76d0602cc9c428637aed0baf21 (commit)
from dd444334eb873bd925639e3141c3a863fad1e47a (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit e7f9ab53656fdfb8a1b27c7056f8dc2c86d8f966
Author: Mukund Sivaraman <muks at isc.org>
Date: Mon Jan 7 14:34:30 2013 +0530
[2432] Use prefix operator++
commit 35d02013f29d19fabf678089ba97db2e67ab3f25
Author: Mukund Sivaraman <muks at isc.org>
Date: Mon Jan 7 14:32:35 2013 +0530
[2432] Minimize code
commit 004823862f69853d3c4acd6f8e0bc60925c25ed1
Author: Mukund Sivaraman <muks at isc.org>
Date: Mon Jan 7 14:30:41 2013 +0530
[2432] Use ASSERT_TRUE to not crash test suite in some places
commit 1fa69473d881a5c31cd802563f2c398e1f6d1ecb
Author: Mukund Sivaraman <muks at isc.org>
Date: Mon Jan 7 14:26:37 2013 +0530
[2432] Fix use of \return (use singular form)
commit 3baea8cf898f2e9dcd35c88e48999b8112732f9d
Author: Mukund Sivaraman <muks at isc.org>
Date: Mon Jan 7 14:25:16 2013 +0530
[2432] Use \throws in API doc
commit 08c2f82000bacb76d0602cc9c428637aed0baf21
Author: Mukund Sivaraman <muks at isc.org>
Date: Mon Jan 7 14:22:18 2013 +0530
[2432] Remove explicit template instantiation in one case
I thought that explicit type name made the code more readable, but maybe
that's not the case so I've removed it now.
It still needs to be specified in the other constructor.
-----------------------------------------------------------------------
Summary of changes:
src/lib/dns/rrset_collection.cc | 2 +-
src/lib/dns/rrset_collection.h | 14 +++++++-------
src/lib/dns/rrset_collection_base.h | 4 ++--
src/lib/dns/tests/rrset_collection_unittest.cc | 17 +++++++----------
4 files changed, 17 insertions(+), 20 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/lib/dns/rrset_collection.cc b/src/lib/dns/rrset_collection.cc
index f8cfbc3..8711c3f 100644
--- a/src/lib/dns/rrset_collection.cc
+++ b/src/lib/dns/rrset_collection.cc
@@ -65,7 +65,7 @@ RRsetCollection::constructHelper(T source, const isc::dns::Name& origin,
RRsetCollection::RRsetCollection(const char* filename, const Name& origin,
const RRClass& rrclass)
{
- constructHelper<const char*>(filename, origin, rrclass);
+ constructHelper(filename, origin, rrclass);
}
RRsetCollection::RRsetCollection(std::istream& input_stream, const Name& origin,
diff --git a/src/lib/dns/rrset_collection.h b/src/lib/dns/rrset_collection.h
index 49dc820..62dd9a9 100644
--- a/src/lib/dns/rrset_collection.h
+++ b/src/lib/dns/rrset_collection.h
@@ -42,9 +42,9 @@ public:
/// The \c origin and \c rrclass arguments are required for the zone
/// loading, but \c RRsetCollection itself does not do any
/// validation, and the collection of RRsets does not have to form a
- /// valid zone. The constructor throws MasterLoaderError if there is
- /// an error during loading.
+ /// valid zone.
///
+ /// \throws MasterLoaderError if there is an error during loading.
/// \param filename Name of a file containing a collection of RRs in
/// the master file format (which may or may not form a valid zone).
/// \param origin The zone origin.
@@ -56,9 +56,9 @@ public:
///
/// This constructor is similar to the previous one, but instead of
/// taking a filename to load a zone from, it takes an input
- /// stream. The constructor throws MasterLoaderError if there is an
- /// error during loading.
+ /// stream.
///
+ /// \throws MasterLoaderError if there is an error during loading.
/// \param input_stream The input stream to load from.
/// \param origin The zone origin.
/// \param rrclass The zone class.
@@ -88,7 +88,7 @@ public:
/// RRset(s) matching the \c name, \c rrclass and \c rrtype are
/// removed from the collection.
///
- /// \returns \c true if a matching RRset was deleted, \c false if no
+ /// \return \c true if a matching RRset was deleted, \c false if no
/// such RRset exists.
bool removeRRset(const isc::dns::Name& name,
const isc::dns::RRClass& rrclass,
@@ -103,7 +103,7 @@ public:
/// \param name The name of the RRset to search for.
/// \param rrclass The class of the RRset to search for.
/// \param rrtype The type of the RRset to search for.
- /// \returns The RRset if found, \c NULL otherwise.
+ /// \return The RRset if found, \c NULL otherwise.
virtual isc::dns::ConstRRsetPtr find(const isc::dns::Name& name,
const isc::dns::RRClass& rrclass,
const isc::dns::RRType& rrtype) const;
@@ -142,7 +142,7 @@ protected:
virtual IterPtr getNext() {
CollectionMap::iterator it = iter_;
- it++;
+ ++it;
return (RRsetCollectionBase::IterPtr(new DnsIter(it)));
}
diff --git a/src/lib/dns/rrset_collection_base.h b/src/lib/dns/rrset_collection_base.h
index 38dc76c..27e46d1 100644
--- a/src/lib/dns/rrset_collection_base.h
+++ b/src/lib/dns/rrset_collection_base.h
@@ -47,7 +47,7 @@ public:
/// \param name The name of the RRset to search for.
/// \param rrtype The type of the RRset to search for.
/// \param rrclass The class of the RRset to search for.
- /// \returns The RRset if found, \c NULL otherwise.
+ /// \return The RRset if found, \c NULL otherwise.
virtual isc::dns::ConstRRsetPtr find
(const isc::dns::Name& name, const isc::dns::RRClass& rrclass,
const isc::dns::RRType& rrtype)
@@ -88,7 +88,7 @@ protected:
/// method must return \c false.
///
/// \param other The other iterator to compare against.
- /// \returns \c true if equal, \c false otherwise.
+ /// \return \c true if equal, \c false otherwise.
virtual bool equals(Iter& other) = 0;
};
diff --git a/src/lib/dns/tests/rrset_collection_unittest.cc b/src/lib/dns/tests/rrset_collection_unittest.cc
index 183ec51..e17e9e7 100644
--- a/src/lib/dns/tests/rrset_collection_unittest.cc
+++ b/src/lib/dns/tests/rrset_collection_unittest.cc
@@ -47,12 +47,12 @@ TEST_F(RRsetCollectionTest, istreamConstructor) {
RRsetCollectionBase::Iterator iter = collection.begin();
RRsetCollectionBase::Iterator iter2 = collection2.begin();
while (iter != collection.end()) {
- EXPECT_TRUE(iter2 != collection2.end());
+ ASSERT_TRUE(iter2 != collection2.end());
EXPECT_EQ((*iter).toText(), (*iter2).toText());
++iter;
++iter2;
}
- EXPECT_TRUE(iter2 == collection2.end());
+ ASSERT_TRUE(iter2 == collection2.end());
}
template <typename T, typename TP>
@@ -125,19 +125,16 @@ doAddAndRemove(RRsetCollection& collection, const RRClass& rrclass) {
}, isc::InvalidParameter);
// Remove foo.example.org/A, which should pass
- bool exists = collection.removeRRset(Name("foo.example.org"),
- rrclass, RRType::A());
- EXPECT_TRUE(exists);
-
+ EXPECT_TRUE(collection.removeRRset(Name("foo.example.org"),
+ rrclass, RRType::A()));
// foo.example.org/A should not exist now
rrset_found = collection.find(Name("foo.example.org"), rrclass,
RRType::A());
EXPECT_FALSE(rrset_found);
// Removing foo.example.org/A should fail now
- exists = collection.removeRRset(Name("foo.example.org"),
- rrclass, RRType::A());
- EXPECT_FALSE(exists);
+ EXPECT_FALSE(collection.removeRRset(Name("foo.example.org"),
+ rrclass, RRType::A()));
}
TEST_F(RRsetCollectionTest, addAndRemove) {
@@ -204,7 +201,7 @@ protected:
virtual IterPtr getNext() {
MyCollection::iterator it = iter_;
- it++;
+ ++it;
return (RRsetCollectionBase::IterPtr(new MyIter(it)));
}
More information about the bind10-changes
mailing list