BIND 10 trac997, updated. a6c21ad6d670896283a941b5bfb233ff5987c50b [trac997] another editorial cleanup: remove a space for style consistency
BIND 10 source code commits
bind10-changes at lists.isc.org
Tue Jun 14 00:56:28 UTC 2011
The branch, trac997 has been updated
via a6c21ad6d670896283a941b5bfb233ff5987c50b (commit)
via 30a20a04aae6b14749980d575cc69180998ca0c9 (commit)
from 46f82ccf0e1984c8b195a5492618f5d065682c3e (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 a6c21ad6d670896283a941b5bfb233ff5987c50b
Author: JINMEI Tatuya <jinmei at isc.org>
Date: Mon Jun 13 17:51:13 2011 -0700
[trac997] another editorial cleanup: remove a space for style consistency
commit 30a20a04aae6b14749980d575cc69180998ca0c9
Author: JINMEI Tatuya <jinmei at isc.org>
Date: Mon Jun 13 17:26:41 2011 -0700
[trac997] minor editorial fixes:
- add blank lines for readability
- remove white space for style consistency
- use "lower+underscore" style for variables (per the guideline)
-----------------------------------------------------------------------
Summary of changes:
src/lib/acl/acl.h | 11 ++++++++---
src/lib/acl/tests/acl_test.cc | 26 +++++++++++++-------------
2 files changed, 21 insertions(+), 16 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/lib/acl/acl.h b/src/lib/acl/acl.h
index 958cdaa..382f00a 100644
--- a/src/lib/acl/acl.h
+++ b/src/lib/acl/acl.h
@@ -59,6 +59,7 @@ private:
* is created).
*/
Acl(const Acl<Context, Action>& other);
+
/**
* \brief Assignment operator.
*
@@ -67,7 +68,8 @@ private:
* added (or, more correctly, this privade one removed so default one
* is created).
*/
- Acl& operator =(const Acl<Context, Action>& other);
+ Acl& operator=(const Acl<Context, Action>& other);
+
public:
/**
* \brief Constructor.
@@ -76,7 +78,8 @@ public:
* "falls off" the end of the list (when no rule matched).
*/
Acl(Action policy) : policy_(policy)
- { }
+ {}
+
/**
* \brief Pointer to the check.
*
@@ -85,6 +88,7 @@ public:
* together in future).
*/
typedef boost::shared_ptr<Check<Context> > CheckPtr;
+
/**
* \brief The actual main function that decides.
*
@@ -97,13 +101,14 @@ public:
*/
Action execute(const Context& context) const {
for (typename Entries::const_iterator i(entries_.begin());
- i != entries_.end(); ++ i) {
+ i != entries_.end(); ++i) {
if (i->first->matches(context)) {
return (i->second);
}
}
return (policy_);
}
+
/**
* \brief Add new entry at the end of the list.
*
diff --git a/src/lib/acl/tests/acl_test.cc b/src/lib/acl/tests/acl_test.cc
index 571257a..8dd8004 100644
--- a/src/lib/acl/tests/acl_test.cc
+++ b/src/lib/acl/tests/acl_test.cc
@@ -31,7 +31,7 @@ struct Log {
bool run[LOG_SIZE];
Log() {
// Nothing run yet
- for (size_t i(0); i < LOG_SIZE; ++ i) {
+ for (size_t i(0); i < LOG_SIZE; ++i) {
run[i] = false;
}
}
@@ -41,14 +41,14 @@ struct Log {
"of log";
{
SCOPED_TRACE("Checking that the first amount of checks did run");
- for (size_t i(0); i < amount; ++ i) {
+ for (size_t i(0); i < amount; ++i) {
EXPECT_TRUE(run[i]) << "Check #" << i << " did not run.";
}
}
{
SCOPED_TRACE("Checking that the rest did not run");
- for (size_t i(amount); i < LOG_SIZE; ++ i) {
+ for (size_t i(amount); i < LOG_SIZE; ++i) {
EXPECT_FALSE(run[i]) << "Check #" << i << "did run.";
}
}
@@ -59,19 +59,19 @@ struct Log {
// But it logs that it did run.
class ConstCheck : public Check<Log*> {
public:
- ConstCheck(bool accepts, size_t logNum) :
- logNum_(logNum),
+ ConstCheck(bool accepts, size_t log_num) :
+ log_num_(log_num),
accepts_(accepts)
{
- assert(logNum < LOG_SIZE); // If this fails, the LOG_SIZE is too small
+ assert(log_num < LOG_SIZE); // If this fails, the LOG_SIZE is too small
}
typedef Log* LPtr;
virtual bool matches(const LPtr& log) const {
- log->run[logNum_] = true;
+ log->run[log_num_] = true;
return (accepts_);
}
private:
- size_t logNum_;
+ size_t log_num_;
bool accepts_;
};
@@ -81,7 +81,7 @@ class TestAcl : public Acl<Log*> {
public:
TestAcl() :
Acl(DROP)
- { }
+ {}
// Check the stored policy there
void checkPolicy(Action ac) {
EXPECT_EQ(policy_, ac);
@@ -93,14 +93,14 @@ public:
class AclTest : public ::testing::Test {
public:
AclTest() :
- nextCheck_(0)
- { }
+ next_check_(0)
+ {}
TestAcl acl_;
Log log_;
- size_t nextCheck_;
+ size_t next_check_;
shared_ptr<Check<Log*> > getCheck(bool accepts) {
return (shared_ptr<Check<Log*> >(new ConstCheck(accepts,
- nextCheck_ ++)));
+ next_check_++)));
}
};
More information about the bind10-changes
mailing list