BIND 10 trac1579, updated. ed4c07d55c90e871d0c2b8ce571273cf83740e66 [1579] various style fixes.
BIND 10 source code commits
bind10-changes at lists.isc.org
Thu Apr 12 00:16:53 UTC 2012
The branch, trac1579 has been updated
via ed4c07d55c90e871d0c2b8ce571273cf83740e66 (commit)
from 77b918b70668c7755f3b7fb8335f5fc1f9f119a6 (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 ed4c07d55c90e871d0c2b8ce571273cf83740e66
Author: JINMEI Tatuya <jinmei at isc.org>
Date: Wed Apr 11 17:15:42 2012 -0700
[1579] various style fixes.
- () for return
- indentation
- brace position
- and a few other small things
-----------------------------------------------------------------------
Summary of changes:
src/lib/datasrc/database.cc | 51 ++++++++++++----------------
src/lib/datasrc/tests/database_unittest.cc | 34 ++++++++-----------
2 files changed, 36 insertions(+), 49 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/lib/datasrc/database.cc b/src/lib/datasrc/database.cc
index 5ae00e7..82028ad 100644
--- a/src/lib/datasrc/database.cc
+++ b/src/lib/datasrc/database.cc
@@ -723,14 +723,12 @@ DatabaseClient::Finder::FindDNSSECContext::FindDNSSECContext(
{}
ZoneFinder::FindOptions
-DatabaseClient::Finder::FindDNSSECContext::getOptions() const
-{
- return options_;
+DatabaseClient::Finder::FindDNSSECContext::getOptions() const {
+ return (options_);
}
void
-DatabaseClient::Finder::FindDNSSECContext::init()
-{
+DatabaseClient::Finder::FindDNSSECContext::init() {
if (finderp_ == NULL) {
isc_throw(DataSourceError, "no Finder to query");
}
@@ -754,30 +752,27 @@ DatabaseClient::Finder::FindDNSSECContext::init()
}
bool
-DatabaseClient::Finder::FindDNSSECContext::isInited()
-{
- return initialized_;
+DatabaseClient::Finder::FindDNSSECContext::isInited() {
+ return (initialized_);
}
bool
-DatabaseClient::Finder::FindDNSSECContext::isNSEC3()
-{
+DatabaseClient::Finder::FindDNSSECContext::isNSEC3() {
if (isInited()) {
- return is_nsec3_;
+ return (is_nsec3_);
} else {
init();
- return is_nsec3_;
+ return (is_nsec3_);
}
}
bool
-DatabaseClient::Finder::FindDNSSECContext::isNSEC()
-{
+DatabaseClient::Finder::FindDNSSECContext::isNSEC() {
if (isInited()) {
- return is_nsec_;
+ return (is_nsec_);
} else {
init();
- return is_nsec_;
+ return (is_nsec_);
}
}
@@ -787,9 +782,9 @@ DatabaseClient::Finder::FindDNSSECContext::getNSECRRset(
{
const FoundIterator nci = found_set.second.find(RRType::NSEC());
if (nci != found_set.second.end()) {
- return nci->second;
+ return (nci->second);
} else {
- return ConstRRsetPtr();
+ return (ConstRRsetPtr());
}
}
@@ -803,9 +798,9 @@ DatabaseClient::Finder::FindDNSSECContext::getNSECRRset(const Name &name) const
true);
const FoundIterator nci = wfound.second.find(RRType::NSEC());
if (nci != wfound.second.end()) {
- return nci->second;
+ return (nci->second);
} else {
- return ConstRRsetPtr();
+ return (ConstRRsetPtr());
}
}
@@ -825,22 +820,20 @@ DatabaseClient::Finder::FindDNSSECContext::getDNSSECRRset(const Name& name,
}
bool
-DatabaseClient::Finder::FindDNSSECContext::isOrigin(const Name &name) const
-{
+DatabaseClient::Finder::FindDNSSECContext::isOrigin(const Name &name) const {
return (name == origin_);
}
ZoneFinder::FindResultFlags
-DatabaseClient::Finder::FindDNSSECContext::getResultFlags()
-{
+DatabaseClient::Finder::FindDNSSECContext::getResultFlags() {
// If it is not DNSSEC query, it should return RESULT_DEFAULT
if ((options_ & FIND_DNSSEC) == 0) {
- return RESULT_DEFAULT;
+ return (RESULT_DEFAULT);
}
// If it is a DNSSEC query and the zone is signed with NSEC3, it should
// return RESULT_NSEC3_SIGNED
if (isNSEC3()) {
- return RESULT_NSEC3_SIGNED;
+ return (RESULT_NSEC3_SIGNED);
} else {
// If it is a DNSSEC query and the zone is signed with NSEC, it should
// return RESULT_NSEC_SIGNED, other else, return RESULT_DEFAULT
@@ -965,7 +958,7 @@ DatabaseClient::Finder::findNoNameResult(const Name& name, const RRType& type,
// for special cases.
if (hasSubdomains(name.toText())) {
- // Does the domain have a subdomain (i.e. it is an empty non-terminal)
+ // Does the domain have a subdomain (i.e. it is an empty non-terminal)?
// If so, return NXRRSET instead of NXDOMAIN (as although the name does
// not exist in the database, it does exist in the DNS tree).
LOG_DEBUG(logger, DBG_TRACE_DETAILED,
@@ -973,7 +966,7 @@ DatabaseClient::Finder::findNoNameResult(const Name& name, const RRType& type,
arg(accessor_->getDBName()).arg(name);
const ConstRRsetPtr nsec = dnssec_ctx.isNSEC() ? findNSECCover(name) :
ConstRRsetPtr();
- if(dnssec_ctx.isNSEC() && (!nsec)){
+ if(dnssec_ctx.isNSEC() && !nsec){
isc_throw(DataSourceError,
"no NSEC RR covers in the NSEC signed zone");
}
@@ -996,7 +989,7 @@ DatabaseClient::Finder::findNoNameResult(const Name& name, const RRType& type,
arg(accessor_->getDBName()).arg(name).arg(type).arg(getClass());
const ConstRRsetPtr nsec = dnssec_ctx.isNSEC() ? findNSECCover(name) :
ConstRRsetPtr();
- if(dnssec_ctx.isNSEC() && (!nsec)){
+ if(dnssec_ctx.isNSEC() && !nsec){
isc_throw(DataSourceError, "no NSEC RR covers in the NSEC signed zone");
}
return (ResultContext(NXDOMAIN, nsec, dnssec_ctx.getResultFlags()));
diff --git a/src/lib/datasrc/tests/database_unittest.cc b/src/lib/datasrc/tests/database_unittest.cc
index bd99f5d..80607b5 100644
--- a/src/lib/datasrc/tests/database_unittest.cc
+++ b/src/lib/datasrc/tests/database_unittest.cc
@@ -2377,10 +2377,10 @@ TYPED_TEST(DatabaseClientTest, nsec3FlagFindDB) {
this->expected_rdatas_.clear();
this->expected_sig_rdatas_.clear();
doFindTest(this->updater_->getFinder(), Name("www1.example.org."),
- this->qtype_, this->qtype_, this->rrttl_, ZoneFinder::NXDOMAIN,
- this->expected_rdatas_, this->expected_sig_rdatas_,
- ZoneFinder::RESULT_NSEC3_SIGNED,Name::ROOT_NAME(),
- ZoneFinder::FIND_DNSSEC);
+ this->qtype_, this->qtype_, this->rrttl_, ZoneFinder::NXDOMAIN,
+ this->expected_rdatas_, this->expected_sig_rdatas_,
+ ZoneFinder::RESULT_NSEC3_SIGNED,Name::ROOT_NAME(),
+ ZoneFinder::FIND_DNSSEC);
// check NXRRSET, it should set RESULT_NSEC3_SIGNED in the flags.
this->expected_rdatas_.clear();
@@ -2446,14 +2446,11 @@ TYPED_TEST(DatabaseClientTest, NXDOMAIN_NSEC) {
}
// If the zone is signed with NSEC, find function should throw an error
// when no NSEC RRset for NXDOMAIN case.
- EXPECT_THROW(doFindTest(*finder,
- isc::dns::Name("notimplnsec.example.org."),
- isc::dns::RRType::TXT(),
- isc::dns::RRType::NSEC(), this->rrttl_,
- ZoneFinder::NXDOMAIN, this->empty_rdatas_,
- this->empty_rdatas_,
- ZoneFinder::RESULT_DEFAULT,
- Name::ROOT_NAME(), ZoneFinder::FIND_DNSSEC),
+ EXPECT_THROW(doFindTest(*finder, Name("notimplnsec.example.org."),
+ RRType::TXT(), RRType::NSEC(), this->rrttl_,
+ ZoneFinder::NXDOMAIN, this->empty_rdatas_,
+ this->empty_rdatas_, ZoneFinder::RESULT_DEFAULT,
+ Name::ROOT_NAME(), ZoneFinder::FIND_DNSSEC),
DataSourceError);
}
@@ -2476,14 +2473,11 @@ TYPED_TEST(DatabaseClientTest, emptyNonterminalNSEC) {
}
// If the zone is signed with NSEC, find function should throw an error
// when no NSEC RRset for NXRRset case
- EXPECT_THROW(doFindTest(*finder,
- isc::dns::Name("here.wild.example.org."),
- isc::dns::RRType::TXT(),
- isc::dns::RRType::NSEC(),
- this->rrttl_, ZoneFinder::NXRRSET,
- this->empty_rdatas_, this->empty_rdatas_,
- ZoneFinder::RESULT_DEFAULT,
- Name::ROOT_NAME(), ZoneFinder::FIND_DNSSEC),
+ EXPECT_THROW(doFindTest(*finder, Name("here.wild.example.org."),
+ RRType::TXT(), RRType::NSEC(), this->rrttl_,
+ ZoneFinder::NXRRSET, this->empty_rdatas_,
+ this->empty_rdatas_, ZoneFinder::RESULT_DEFAULT,
+ Name::ROOT_NAME(), ZoneFinder::FIND_DNSSEC),
DataSourceError);
}
More information about the bind10-changes
mailing list