BIND 10 trac1177, updated. 51c4b53945599a72d550d7380c7107e11b467d5c [1177] some minor, mainly editorial, changes: coding style, typo, simplify, constify, etc.
BIND 10 source code commits
bind10-changes at lists.isc.org
Wed Sep 14 05:56:21 UTC 2011
The branch, trac1177 has been updated
via 51c4b53945599a72d550d7380c7107e11b467d5c (commit)
from 84d7ae48d44e055cb16e3900cf2c4b2262f6a6da (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 51c4b53945599a72d550d7380c7107e11b467d5c
Author: JINMEI Tatuya <jinmei at isc.org>
Date: Tue Sep 13 22:55:29 2011 -0700
[1177] some minor, mainly editorial, changes: coding style, typo, simplify, constify, etc.
-----------------------------------------------------------------------
Summary of changes:
src/lib/datasrc/database.cc | 6 ++--
src/lib/datasrc/sqlite3_accessor.cc | 1 -
src/lib/datasrc/tests/database_unittest.cc | 34 ++++++++++------------------
src/lib/datasrc/zone.h | 2 +-
4 files changed, 16 insertions(+), 27 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/lib/datasrc/database.cc b/src/lib/datasrc/database.cc
index 08e642b..8cc7092 100644
--- a/src/lib/datasrc/database.cc
+++ b/src/lib/datasrc/database.cc
@@ -316,8 +316,8 @@ DatabaseClient::Finder::find(const isc::dns::Name& name,
// This variable is used to determine the difference between
// NXDOMAIN and NXRRSET
bool records_found = false;
- bool glue_ok(options & FIND_GLUE_OK);
- bool dnssec_data(options & FIND_DNSSEC);
+ bool glue_ok((options & FIND_GLUE_OK) != 0);
+ const bool dnssec_data((options & FIND_DNSSEC) != 0);
bool get_cover(false);
isc::dns::RRsetPtr result_rrset;
ZoneFinder::Result result_status = SUCCESS;
@@ -533,7 +533,7 @@ DatabaseClient::Finder::find(const isc::dns::Name& name,
}
}
// This is the NXDOMAIN case (nothing found anywhere). If
- // they wand DNSSEC data, try getting the NSEC record
+ // they want DNSSEC data, try getting the NSEC record
if (dnssec_data && !records_found) {
get_cover = true;
}
diff --git a/src/lib/datasrc/sqlite3_accessor.cc b/src/lib/datasrc/sqlite3_accessor.cc
index a5ac4c7..2093dcb 100644
--- a/src/lib/datasrc/sqlite3_accessor.cc
+++ b/src/lib/datasrc/sqlite3_accessor.cc
@@ -725,7 +725,6 @@ SQLite3Accessor::findPreviousName(int zone_id, const std::string& rname)
statements_[FIND_PREVIOUS_WRAP], 0), dbparameters_->db_);
}
sqlite3_reset(dbparameters_->statements_[FIND_PREVIOUS_WRAP]);
-
if (rc == SQLITE_DONE) {
// No NSEC records, this DB doesn't support DNSSEC
isc_throw(isc::NotImplemented, "The zone doesn't support DNSSEC");
diff --git a/src/lib/datasrc/tests/database_unittest.cc b/src/lib/datasrc/tests/database_unittest.cc
index 35827f5..4a8309c 100644
--- a/src/lib/datasrc/tests/database_unittest.cc
+++ b/src/lib/datasrc/tests/database_unittest.cc
@@ -1582,7 +1582,7 @@ TYPED_TEST(DatabaseClientTest, wildcard) {
TYPED_TEST(DatabaseClientTest, NXRRSET_NSEC) {
// The domain exists, but doesn't have this RRType
- // So we should get it's NSEC
+ // So we should get its NSEC
shared_ptr<DatabaseClient::Finder> finder(this->getFinder());
this->expected_rdatas_.push_back("www2.example.org. A AAAA NSEC RRSIG");
@@ -1591,15 +1591,14 @@ TYPED_TEST(DatabaseClientTest, NXRRSET_NSEC) {
"FAKEFAKEFAKE");
doFindTest(*finder, isc::dns::Name("www.example.org."),
isc::dns::RRType::TXT(), isc::dns::RRType::NSEC(),
- isc::dns::RRTTL(3600),
- ZoneFinder::NXRRSET,
+ this->rrttl_, ZoneFinder::NXRRSET,
this->expected_rdatas_, this->expected_sig_rdatas_,
Name::ROOT_NAME(), ZoneFinder::FIND_DNSSEC);
}
TYPED_TEST(DatabaseClientTest, wildcardNXRRSET_NSEC) {
// The domain exists, but doesn't have this RRType
- // So we should get it's NSEC
+ // So we should get its NSEC
//
// The user will have to query us again to get the correct
// answer (eg. prove there's not an exact match)
@@ -1613,8 +1612,7 @@ TYPED_TEST(DatabaseClientTest, wildcardNXRRSET_NSEC) {
// Note that the NSEC name should NOT be synthesized.
doFindTest(*finder, isc::dns::Name("a.wild.example.org."),
isc::dns::RRType::TXT(), isc::dns::RRType::NSEC(),
- isc::dns::RRTTL(3600),
- ZoneFinder::WILDCARD_NXRRSET,
+ this->rrttl_, ZoneFinder::WILDCARD_NXRRSET,
this->expected_rdatas_, this->expected_sig_rdatas_,
Name("*.wild.example.org"), ZoneFinder::FIND_DNSSEC);
}
@@ -1629,8 +1627,7 @@ TYPED_TEST(DatabaseClientTest, NXDOMAIN_NSEC) {
"FAKEFAKEFAKE");
doFindTest(*finder, isc::dns::Name("www1.example.org."),
isc::dns::RRType::TXT(), isc::dns::RRType::NSEC(),
- isc::dns::RRTTL(3600),
- ZoneFinder::NXDOMAIN,
+ this->rrttl_, ZoneFinder::NXDOMAIN,
this->expected_rdatas_, this->expected_sig_rdatas_,
Name("www.example.org."), ZoneFinder::FIND_DNSSEC);
@@ -1639,16 +1636,13 @@ TYPED_TEST(DatabaseClientTest, NXDOMAIN_NSEC) {
if (!this->is_mock_) {
return; // We don't make the real DB to throw
}
- this->expected_rdatas_.clear();
- this->expected_sig_rdatas_.clear();
EXPECT_NO_THROW(doFindTest(*finder,
isc::dns::Name("notimplnsec.example.org."),
isc::dns::RRType::TXT(),
- isc::dns::RRType::NSEC(),
- isc::dns::RRTTL(3600), ZoneFinder::NXDOMAIN,
- this->expected_rdatas_,
- this->expected_sig_rdatas_,
- Name::ROOT_NAME(), ZoneFinder::FIND_DNSSEC));
+ isc::dns::RRType::NSEC(), this->rrttl_,
+ ZoneFinder::NXDOMAIN, this->empty_rdatas_,
+ this->empty_rdatas_, Name::ROOT_NAME(),
+ ZoneFinder::FIND_DNSSEC));
}
TYPED_TEST(DatabaseClientTest, emptyNonterminalNSEC) {
@@ -1660,8 +1654,7 @@ TYPED_TEST(DatabaseClientTest, emptyNonterminalNSEC) {
this->expected_rdatas_.push_back("empty.nonterminal.example.org. NSEC");
doFindTest(*finder, isc::dns::Name("nonterminal.example.org."),
- isc::dns::RRType::TXT(), isc::dns::RRType::NSEC(),
- isc::dns::RRTTL(3600),
+ isc::dns::RRType::TXT(), isc::dns::RRType::NSEC(), this->rrttl_,
ZoneFinder::NXRRSET, // FIXME: Do we want to have specific code?
this->expected_rdatas_, this->expected_sig_rdatas_,
Name("l.example.org."), ZoneFinder::FIND_DNSSEC);
@@ -1671,15 +1664,12 @@ TYPED_TEST(DatabaseClientTest, emptyNonterminalNSEC) {
if (!this->is_mock_) {
return; // We don't make the real DB to throw
}
- this->expected_rdatas_.clear();
- this->expected_sig_rdatas_.clear();
EXPECT_NO_THROW(doFindTest(*finder,
isc::dns::Name("here.wild.example.org."),
isc::dns::RRType::TXT(),
isc::dns::RRType::NSEC(),
- isc::dns::RRTTL(3600), ZoneFinder::NXRRSET,
- this->expected_rdatas_,
- this->expected_sig_rdatas_,
+ this->rrttl_, ZoneFinder::NXRRSET,
+ this->empty_rdatas_, this->empty_rdatas_,
Name::ROOT_NAME(), ZoneFinder::FIND_DNSSEC));
}
diff --git a/src/lib/datasrc/zone.h b/src/lib/datasrc/zone.h
index 61fd5fb..14bf295 100644
--- a/src/lib/datasrc/zone.h
+++ b/src/lib/datasrc/zone.h
@@ -212,7 +212,7 @@ public:
/// \brief Get previous name in the zone
///
/// Gets the previous name in the DNSSEC/NSEC order. This can be used
- /// to find the correct NSEC records for proving nonexistenc
+ /// to find the correct NSEC records for proving nonexistence
/// of domains.
///
/// The concrete implementation might throw anything it thinks appropriate,
More information about the bind10-changes
mailing list