BIND 10 trac826, updated. 52346cbce7274e7a598be24b4f8a3eccf090e4f1 libacl

BIND 10 source code commits bind10-changes at lists.isc.org
Thu Jun 28 13:40:11 UTC 2012


The branch, trac826 has been updated
       via  52346cbce7274e7a598be24b4f8a3eccf090e4f1 (commit)
      from  6f61d1e1efebe490973228a8c9da69634cc52632 (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 52346cbce7274e7a598be24b4f8a3eccf090e4f1
Author: Francis Dupont <fdupont at isc.org>
Date:   Thu Jun 28 15:40:02 2012 +0200

    libacl

-----------------------------------------------------------------------

Summary of changes:
 src/lib/acl/dns.cc                           |    5 +++--
 src/lib/acl/dns.h                            |    7 ++-----
 src/lib/acl/dnsname_check.h                  |    2 --
 src/lib/acl/ip_check.cc                      |    1 +
 src/lib/acl/loader.h                         |    9 +++------
 src/lib/{cryptolink => acl}/tests/.gitignore |    0
 src/lib/acl/tests/Makefile.am                |    3 +++
 src/lib/acl/tests/acl_test.cc                |    5 ++---
 src/lib/acl/tests/creators.h                 |    5 -----
 src/lib/acl/tests/ip_check_unittest.cc       |    8 ++++----
 src/lib/acl/tests/loader_test.cc             |   19 ++++++++++---------
 src/lib/acl/tests/logic_check_test.cc        |    3 ++-
 12 files changed, 30 insertions(+), 37 deletions(-)
 copy src/lib/{cryptolink => acl}/tests/.gitignore (100%)

-----------------------------------------------------------------------
diff --git a/src/lib/acl/dns.cc b/src/lib/acl/dns.cc
index 5352de6..d16ec65 100644
--- a/src/lib/acl/dns.cc
+++ b/src/lib/acl/dns.cc
@@ -115,8 +115,9 @@ getRequestLoader() {
             auto_ptr<RequestLoader>(new RequestLoader(REJECT));
 
         // Register default check creator(s)
-        loader_ptr->registerCreator(boost::shared_ptr<internal::RequestCheckCreator>(
-                                        new internal::RequestCheckCreator()));
+        loader_ptr->registerCreator(
+            boost::shared_ptr<internal::RequestCheckCreator>(
+                new internal::RequestCheckCreator()));
         loader_ptr->registerCreator(
             boost::shared_ptr<NotCreator<RequestContext> >(
                 new NotCreator<RequestContext>("NOT")));
diff --git a/src/lib/acl/dns.h b/src/lib/acl/dns.h
index 4eba905..d08fcf3 100644
--- a/src/lib/acl/dns.h
+++ b/src/lib/acl/dns.h
@@ -71,8 +71,8 @@ struct RequestContext {
     ///
     /// \exception None
     ///
-    /// \parameter remote_address_param The remote IP address
-    /// \parameter tsig_param A valid pointer to the TSIG record included in
+    /// \param remote_address_param The remote IP address
+    /// \param tsig_param A valid pointer to the TSIG record included in
     /// the request or NULL if the request doesn't contain a TSIG.
     RequestContext(const IPAddress& remote_address_param,
                    const isc::dns::TSIGRecord* tsig_param) :
@@ -97,9 +97,6 @@ struct RequestContext {
     /// If the request doesn't include a TSIG, this member will be NULL.
     const isc::dns::TSIGRecord* const tsig;
     //@}
-private:
-    // silence MSVC warning C4512: assignment operator could not be generated
-    RequestContext& operator=(RequestContext const&);
 };
 
 /// \brief DNS based check.
diff --git a/src/lib/acl/dnsname_check.h b/src/lib/acl/dnsname_check.h
index 56115b9..7498d99 100644
--- a/src/lib/acl/dnsname_check.h
+++ b/src/lib/acl/dnsname_check.h
@@ -70,8 +70,6 @@ public:
 
 private:
     const isc::dns::Name name_;
-    // silence MSVC warning C4512: assignment operator could not be generated
-    NameCheck& operator=(NameCheck const&);
 };
 
 } // namespace dns
diff --git a/src/lib/acl/ip_check.cc b/src/lib/acl/ip_check.cc
index 867ad71..85b6bc6 100644
--- a/src/lib/acl/ip_check.cc
+++ b/src/lib/acl/ip_check.cc
@@ -13,6 +13,7 @@
 // PERFORMANCE OF THIS SOFTWARE.
 
 #ifndef _WIN32
+#include <sys/types.h>
 #include <sys/socket.h>
 #endif
 
diff --git a/src/lib/acl/loader.h b/src/lib/acl/loader.h
index 9f663e3..fc69b44 100644
--- a/src/lib/acl/loader.h
+++ b/src/lib/acl/loader.h
@@ -125,7 +125,7 @@ BasicAction defaultActionLoader(data::ConstElementPtr action);
  *
  * The rest of the element are matches. The left side is the name of the
  * match type (for example match for source IP address or match for message
- * size). The <parameter> is whatever is needed to describe the match and
+ * size). The parameter is whatever is needed to describe the match and
  * depends on the match type, the loader passes it verbatim to creator
  * of that match type.
  *
@@ -148,7 +148,7 @@ public:
     /**
      * \brief Constructor.
      *
-     * \param default_action The default action for created ACLs.
+     * \param defaultAction The default action for created ACLs.
      * \param actionLoader is the loader which will be used to convert actions
      *     from their JSON representation. The default value is suitable for
      *     the BasicAction enum. If you did not specify the second
@@ -202,7 +202,7 @@ public:
          *     parameters might look like, they are not checked in any way.
          *     Therefore it's up to the creator (or the check being created)
          *     to validate the data and throw if it is bad.
-         * \param Current loader calling this creator. This can be used
+         * \param loader Current loader calling this creator. This can be used
          *     to load subexpressions in case of compound check.
          */
         virtual boost::shared_ptr<Check<Context> > create(
@@ -454,9 +454,6 @@ private:
         // input
         virtual std::string toText() const { return ""; }
     };
-
-    // silence MSVC warning C4512: assignment operator could not be generated
-    Loader& operator=(Loader const&);
 };
 
 }
diff --git a/src/lib/acl/tests/.gitignore b/src/lib/acl/tests/.gitignore
new file mode 100644
index 0000000..d6d1ec8
--- /dev/null
+++ b/src/lib/acl/tests/.gitignore
@@ -0,0 +1 @@
+/run_unittests
diff --git a/src/lib/acl/tests/Makefile.am b/src/lib/acl/tests/Makefile.am
index 6369511..9183bfe 100644
--- a/src/lib/acl/tests/Makefile.am
+++ b/src/lib/acl/tests/Makefile.am
@@ -8,6 +8,9 @@ endif
 
 CLEANFILES = *.gcno *.gcda
 
+TESTS_ENVIRONMENT = \
+	$(LIBTOOL) --mode=execute $(VALGRIND_COMMAND)
+
 TESTS =
 if HAVE_GTEST
 TESTS += run_unittests
diff --git a/src/lib/acl/tests/acl_test.cc b/src/lib/acl/tests/acl_test.cc
index 15ffef6..485a5a3 100644
--- a/src/lib/acl/tests/acl_test.cc
+++ b/src/lib/acl/tests/acl_test.cc
@@ -18,7 +18,6 @@
 
 using namespace isc::acl;
 using namespace isc::acl::tests;
-using boost::shared_ptr;
 
 namespace {
 
@@ -46,8 +45,8 @@ public:
     Log log_;
     size_t next_check_;
     boost::shared_ptr<Check<Log> > getCheck(bool accepts) {
-        return (shared_ptr<Check<Log> >(new ConstCheck(accepts,
-                                                       next_check_++)));
+        return (boost::shared_ptr<Check<Log> >(new ConstCheck(accepts,
+                                                              next_check_++)));
     }
 };
 
diff --git a/src/lib/acl/tests/creators.h b/src/lib/acl/tests/creators.h
index a74c724..584df71 100644
--- a/src/lib/acl/tests/creators.h
+++ b/src/lib/acl/tests/creators.h
@@ -39,9 +39,6 @@ public:
     virtual bool matches(const Log&) const { return (true); }
     const std::string name_;
     const isc::data::ConstElementPtr data_;
-private:
-    // silence MSVC warning C4512: assignment operator could not be generated
-    NamedCheck& operator=(NamedCheck const&);
 };
 
 // The creator of NamedCheck
@@ -81,8 +78,6 @@ public:
 private:
     std::vector<std::string> names_;
     const bool abbreviated_list_;
-    // silence MSVC warning C4512: assignment operator could not be generated
-    NamedCreator& operator=(NamedCreator const&);
 };
 
 // To be thrown in tests internally
diff --git a/src/lib/acl/tests/ip_check_unittest.cc b/src/lib/acl/tests/ip_check_unittest.cc
index cb7eb24..5a21524 100644
--- a/src/lib/acl/tests/ip_check_unittest.cc
+++ b/src/lib/acl/tests/ip_check_unittest.cc
@@ -164,7 +164,7 @@ TEST(IPFunctionCheck, SplitIPAddress) {
 
 TEST(IPAddress, constructIPv4) {
     IPAddress ipaddr(tests::getSockAddr("192.0.2.1"));
-    const unsigned char expected_data[4] = { 192, 0, 2, 1 };
+    const uint8_t expected_data[4] = { 192, 0, 2, 1 };
     EXPECT_EQ(AF_INET, ipaddr.getFamily());
     EXPECT_EQ(4, ipaddr.getLength());
     EXPECT_EQ(0, memcmp(expected_data, ipaddr.getData(), 4));
@@ -172,9 +172,9 @@ TEST(IPAddress, constructIPv4) {
 
 TEST(IPAddress, constructIPv6) {
     IPAddress ipaddr(tests::getSockAddr("2001:db8:1234:abcd::53"));
-    const unsigned char expected_data[16] = {
-        0x20, 0x01, 0x0d, 0xb8, 0x12, 0x34, 0xab, 0xcd,
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x53 };
+    const uint8_t expected_data[16] = { 0x20, 0x01, 0x0d, 0xb8, 0x12, 0x34, 0xab,
+                                        0xcd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+                                        0x00, 0x53 };
     EXPECT_EQ(AF_INET6, ipaddr.getFamily());
     EXPECT_EQ(16, ipaddr.getLength());
     EXPECT_EQ(0, memcmp(expected_data, ipaddr.getData(), 16));
diff --git a/src/lib/acl/tests/loader_test.cc b/src/lib/acl/tests/loader_test.cc
index d8f67f4..451f195 100644
--- a/src/lib/acl/tests/loader_test.cc
+++ b/src/lib/acl/tests/loader_test.cc
@@ -74,22 +74,21 @@ public:
                                           bool abbreviatedList = true)
     {
         return (boost::shared_ptr<NamedCreator>(new NamedCreator(name,
-                                                          abbreviatedList)));
+                                                    abbreviatedList)));
     }
     // Create and add a NamedCreator
     void addNamed(const string& name, bool abbreviatedList = true) {
         EXPECT_NO_THROW(loader_.registerCreator(
             namedCreator(name, abbreviatedList)));
     }
-    template<class Result> boost::shared_ptr<Result> loadCheckAny(const string&
-                                                               definition)
+    template<class Result> boost::shared_ptr<Result> loadCheckAny(
+        const string& definition)
     {
         SCOPED_TRACE("Loading check " + definition);
         boost::shared_ptr<Check<Log> > loaded;
         EXPECT_NO_THROW(loaded = loader_.loadCheck(
                             Element::fromJSON(definition)));
-        boost::shared_ptr<Result> result(dynamic_pointer_cast<Result>(
-            loaded));
+        boost::shared_ptr<Result> result(dynamic_pointer_cast<Result>(loaded));
         EXPECT_TRUE(result);
         return (result);
     }
@@ -114,11 +113,12 @@ public:
     // Insert the throw, throwcheck and logcheck checks into the loader
     void aclSetup() {
         try {
-            loader_.registerCreator(boost::shared_ptr<ThrowCreator>(new
-                                                             ThrowCreator()));
+            loader_.registerCreator(boost::shared_ptr<ThrowCreator>(
+                new ThrowCreator()));
             loader_.registerCreator(boost::shared_ptr<ThrowCheckCreator>(
                 new ThrowCheckCreator()));
-            loader_.registerCreator(boost::shared_ptr<LogCreator>(new LogCreator()));
+            loader_.registerCreator(boost::shared_ptr<LogCreator>(
+                new LogCreator()));
         }
         // We ignore this exception here, because it happens when we try to
         // insert the creators multiple times. This is harmless.
@@ -230,7 +230,8 @@ TEST_F(LoaderTest, UnkownName) {
 
 // Exception from the creator is propagated
 TEST_F(LoaderTest, CheckPropagate) {
-    loader_.registerCreator(boost::shared_ptr<ThrowCreator>(new ThrowCreator()));
+    loader_.registerCreator(boost::shared_ptr<ThrowCreator>(
+                                new ThrowCreator()));
     EXPECT_THROW(loader_.loadCheck(Element::fromJSON("{\"throw\": null}")),
                  TestCreatorError);
 }
diff --git a/src/lib/acl/tests/logic_check_test.cc b/src/lib/acl/tests/logic_check_test.cc
index 18f663f..0ecd2cc 100644
--- a/src/lib/acl/tests/logic_check_test.cc
+++ b/src/lib/acl/tests/logic_check_test.cc
@@ -244,7 +244,8 @@ TEST_F(LogicCreatorTest, nested) {
 }
 
 void notTest(bool value) {
-    NotOperator<Log> notOp(boost::shared_ptr<Check<Log> >(new ConstCheck(value, 0)));
+    NotOperator<Log> notOp(boost::shared_ptr<Check<Log> >(
+                                new ConstCheck(value, 0)));
     Log log;
     // It returns negated value
     EXPECT_EQ(!value, notOp.matches(log));



More information about the bind10-changes mailing list