[svn] commit: r3383 - in /trunk: ./ src/bin/auth/ src/bin/auth/benchmarks/ src/bin/auth/tests/ src/bin/host/ src/lib/bench/ src/lib/bench/example/ src/lib/bench/tests/ src/lib/cc/ src/lib/cc/tests/ src/lib/config/ src/lib/config/tests/ src/lib/datasrc/ src/lib/datasrc/tests/ src/lib/dns/ src/lib/dns/python/ src/lib/dns/rdata/generic/ src/lib/dns/tests/ src/lib/xfr/

BIND 10 source code commits bind10-changes at lists.isc.org
Thu Oct 28 08:37:29 UTC 2010


Author: jinmei
Date: Thu Oct 28 08:37:28 2010
New Revision: 3383

Log:
merged trac #365: clang++ support

Modified:
    trunk/   (props changed)
    trunk/configure.ac
    trunk/src/bin/auth/Makefile.am
    trunk/src/bin/auth/asio_link.h
    trunk/src/bin/auth/benchmarks/Makefile.am
    trunk/src/bin/auth/tests/Makefile.am
    trunk/src/bin/auth/tests/auth_srv_unittest.cc
    trunk/src/bin/host/Makefile.am
    trunk/src/lib/bench/Makefile.am
    trunk/src/lib/bench/example/search_bench.cc
    trunk/src/lib/bench/tests/Makefile.am
    trunk/src/lib/cc/Makefile.am
    trunk/src/lib/cc/tests/Makefile.am
    trunk/src/lib/cc/tests/data_unittests.cc
    trunk/src/lib/config/Makefile.am
    trunk/src/lib/config/tests/Makefile.am
    trunk/src/lib/config/tests/ccsession_unittests.cc
    trunk/src/lib/datasrc/Makefile.am
    trunk/src/lib/datasrc/tests/Makefile.am
    trunk/src/lib/dns/Makefile.am
    trunk/src/lib/dns/python/Makefile.am
    trunk/src/lib/dns/rdata/generic/opt_41.cc
    trunk/src/lib/dns/tests/Makefile.am
    trunk/src/lib/dns/tests/name_unittest.cc
    trunk/src/lib/dns/tests/rdata_ns_unittest.cc
    trunk/src/lib/dns/tests/rdata_ptr_unittest.cc
    trunk/src/lib/dns/tests/rdata_unittest.cc
    trunk/src/lib/xfr/Makefile.am

Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac (original)
+++ trunk/configure.ac Thu Oct 28 08:37:28 2010
@@ -17,6 +17,8 @@
 # Identify the compiler: this check must be after AC_PROG_CXX and AC_LANG.
 AM_CONDITIONAL(USE_GXX, test "X${GXX}" = "Xyes")
 AC_CHECK_DECL([__SUNPRO_CC], [SUNCXX="yes"], [SUNCXX="no"])
+AC_CHECK_DECL([__clang__], [CLANGPP="yes"], [CLANGPP="no"])
+AM_CONDITIONAL(USE_CLANGPP, test "X${CLANGPP}" = "Xyes")
 
 # Linker options
 
@@ -313,12 +315,14 @@
 		fi
 	done
 fi
+CPPFLAGS_SAVES="$CPPFLAGS"
 if test "${boost_include_path}" ; then
 	BOOST_INCLUDES="-I${boost_include_path}"
 	CPPFLAGS="$CPPFLAGS $BOOST_INCLUDES"
 fi
 AC_CHECK_HEADERS([boost/shared_ptr.hpp boost/foreach.hpp],,
   AC_MSG_ERROR([Missing required header files.]))
+CPPFLAGS="$CPPFLAGS_SAVES"
 AC_SUBST(BOOST_INCLUDES)
 
 #
@@ -604,6 +608,8 @@
   Name:          $PACKAGE_NAME
   Version:       $PACKAGE_VERSION
 
+C++ Compiler:    $CXX
+
 Flags:
   DEFS:          $DEFS
   CPPFLAGS:      $CPPFLAGS
@@ -613,6 +619,7 @@
   Python:        ${PYTHON_INCLUDES}
                  ${PYTHON_LDFLAGS}
                  ${PYTHON_LIB}
+  Boost:         ${BOOST_INCLUDES}
   SQLite:        $SQLITE_CFLAGS
                  $SQLITE_LIBS
 
@@ -632,4 +639,3 @@
   Now you can type "make" to build BIND 10
 
 EOF
-

Modified: trunk/src/bin/auth/Makefile.am
==============================================================================
--- trunk/src/bin/auth/Makefile.am (original)
+++ trunk/src/bin/auth/Makefile.am Thu Oct 28 08:37:28 2010
@@ -5,6 +5,7 @@
 AM_CPPFLAGS += -I$(top_srcdir)/src/lib/dns -I$(top_builddir)/src/lib/dns
 AM_CPPFLAGS += -I$(top_builddir)/src/lib/cc
 AM_CPPFLAGS += -I$(top_srcdir)/src/bin -I$(top_builddir)/src/bin
+AM_CPPFLAGS += $(BOOST_INCLUDES)
 
 AM_CXXFLAGS = $(B10_CXXFLAGS)
 
@@ -46,6 +47,10 @@
 if USE_GXX
 libasio_link_a_CXXFLAGS += -Wno-unused-parameter
 endif
+if USE_CLANGPP
+# Same for clang++, but we need to turn off -Werror completely.
+libasio_link_a_CXXFLAGS += -Wno-error
+endif
 libasio_link_a_CPPFLAGS = $(AM_CPPFLAGS)
 
 BUILT_SOURCES = spec_config.h 

Modified: trunk/src/bin/auth/asio_link.h
==============================================================================
--- trunk/src/bin/auth/asio_link.h (original)
+++ trunk/src/bin/auth/asio_link.h Thu Oct 28 08:37:28 2010
@@ -88,7 +88,7 @@
 /// http://think-async.com/Asio/asio-1.3.1/doc/asio/reference/asio_handler_allocate.html
 
 namespace asio_link {
-struct IOServiceImpl;
+class IOServiceImpl;
 
 /// \brief An exception that is thrown if an error occurs within the IO
 /// module.  This is mainly intended to be a wrapper exception class for

Modified: trunk/src/bin/auth/benchmarks/Makefile.am
==============================================================================
--- trunk/src/bin/auth/benchmarks/Makefile.am (original)
+++ trunk/src/bin/auth/benchmarks/Makefile.am Thu Oct 28 08:37:28 2010
@@ -1,5 +1,6 @@
 AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
 AM_CPPFLAGS += -I$(top_srcdir)/src/bin -I$(top_builddir)/src/bin
+AM_CPPFLAGS += $(BOOST_INCLUDES)
 
 AM_CXXFLAGS = $(B10_CXXFLAGS)
 

Modified: trunk/src/bin/auth/tests/Makefile.am
==============================================================================
--- trunk/src/bin/auth/tests/Makefile.am (original)
+++ trunk/src/bin/auth/tests/Makefile.am Thu Oct 28 08:37:28 2010
@@ -3,6 +3,7 @@
 AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
 AM_CPPFLAGS += -I$(top_builddir)/src/lib/dns -I$(top_srcdir)/src/bin
 AM_CPPFLAGS += -I$(top_builddir)/src/lib/cc
+AM_CPPFLAGS += $(BOOST_INCLUDES)
 AM_CPPFLAGS += -DTEST_DATA_DIR=\"$(srcdir)/testdata\"
 AM_CPPFLAGS += -DTEST_DATA_BUILDDIR=\"$(abs_top_builddir)/src/bin/auth/tests/testdata\"
 

Modified: trunk/src/bin/auth/tests/auth_srv_unittest.cc
==============================================================================
--- trunk/src/bin/auth/tests/auth_srv_unittest.cc (original)
+++ trunk/src/bin/auth/tests/auth_srv_unittest.cc Thu Oct 28 08:37:28 2010
@@ -348,8 +348,8 @@
         data[2] = ((i << 3) & 0xff);
 
         parse_message.clear(Message::PARSE);
-        EXPECT_EQ(true, server.processMessage(*io_message, parse_message,
-                                              response_renderer));
+        EXPECT_TRUE(server.processMessage(*io_message, parse_message,
+                                          response_renderer));
         headerCheck(parse_message, default_qid, Rcode::NOTIMP(), i, QR_FLAG,
                     0, 0, 0, 0);
     }
@@ -367,8 +367,8 @@
 // Multiple questions.  Should result in FORMERR.
 TEST_F(AuthSrvTest, multiQuestion) {
     createDataFromFile("multiquestion_fromWire.wire");
-    EXPECT_EQ(true, server.processMessage(*io_message, parse_message,
-                                          response_renderer));
+    EXPECT_TRUE(server.processMessage(*io_message, parse_message,
+                                      response_renderer));
     headerCheck(parse_message, default_qid, Rcode::FORMERR(), opcode.getCode(),
                 QR_FLAG, 2, 0, 0, 0);
 
@@ -388,8 +388,8 @@
 // dropped.
 TEST_F(AuthSrvTest, shortMessage) {
     createDataFromFile("shortmessage_fromWire");
-    EXPECT_EQ(false, server.processMessage(*io_message, parse_message,
-                                           response_renderer));
+    EXPECT_FALSE(server.processMessage(*io_message, parse_message,
+                                       response_renderer));
 }
 
 // Response messages.  Must be silently dropped, whether it's a valid response
@@ -397,26 +397,26 @@
 TEST_F(AuthSrvTest, response) {
     // A valid (although unusual) response
     createDataFromFile("simpleresponse_fromWire.wire");
-    EXPECT_EQ(false, server.processMessage(*io_message, parse_message,
-                                           response_renderer));
+    EXPECT_FALSE(server.processMessage(*io_message, parse_message,
+                                       response_renderer));
 
     // A response with a broken question section.  must be dropped rather than
     // returning FORMERR.
     createDataFromFile("shortresponse_fromWire");
-    EXPECT_EQ(false, server.processMessage(*io_message, parse_message,
-                                           response_renderer));
+    EXPECT_FALSE(server.processMessage(*io_message, parse_message,
+                                       response_renderer));
 
     // A response to iquery.  must be dropped rather than returning NOTIMP.
     createDataFromFile("iqueryresponse_fromWire.wire");
-    EXPECT_EQ(false, server.processMessage(*io_message, parse_message,
-                                           response_renderer));
+    EXPECT_FALSE(server.processMessage(*io_message, parse_message,
+                                       response_renderer));
 }
 
 // Query with a broken question
 TEST_F(AuthSrvTest, shortQuestion) {
     createDataFromFile("shortquestion_fromWire");
-    EXPECT_EQ(true, server.processMessage(*io_message, parse_message,
-                                          response_renderer));
+    EXPECT_TRUE(server.processMessage(*io_message, parse_message,
+                                      response_renderer));
     // Since the query's question is broken, the question section of the
     // response should be empty.
     headerCheck(parse_message, default_qid, Rcode::FORMERR(), opcode.getCode(),
@@ -426,8 +426,8 @@
 // Query with a broken answer section
 TEST_F(AuthSrvTest, shortAnswer) {
     createDataFromFile("shortanswer_fromWire.wire");
-    EXPECT_EQ(true, server.processMessage(*io_message, parse_message,
-                                          response_renderer));
+    EXPECT_TRUE(server.processMessage(*io_message, parse_message,
+                                      response_renderer));
 
     // This is a bogus query, but question section is valid.  So the response
     // should copy the question section.
@@ -445,8 +445,8 @@
 // Query with unsupported version of EDNS.
 TEST_F(AuthSrvTest, ednsBadVers) {
     createDataFromFile("queryBadEDNS_fromWire.wire");
-    EXPECT_EQ(true, server.processMessage(*io_message, parse_message,
-                                          response_renderer));
+    EXPECT_TRUE(server.processMessage(*io_message, parse_message,
+                                      response_renderer));
 
     // The response must have an EDNS OPT RR in the additional section, but
     // it will be added automatically at the render time.
@@ -468,8 +468,8 @@
     // AXFR over UDP is invalid and should result in FORMERR.
     createRequestPacket(opcode, Name("example.com"), RRClass::IN(),
                         RRType::AXFR(), IPPROTO_UDP);
-    EXPECT_EQ(true, server.processMessage(*io_message, parse_message,
-                                          response_renderer));
+    EXPECT_TRUE(server.processMessage(*io_message, parse_message,
+                                      response_renderer));
     headerCheck(parse_message, default_qid, Rcode::FORMERR(), opcode.getCode(),
                 QR_FLAG, 1, 0, 0, 0);
 }
@@ -480,8 +480,8 @@
                         RRType::AXFR(), IPPROTO_TCP);
     // On success, the AXFR query has been passed to a separate process,
     // so we shouldn't have to respond.
-    EXPECT_EQ(false, server.processMessage(*io_message, parse_message,
-                                           response_renderer));
+    EXPECT_FALSE(server.processMessage(*io_message, parse_message,
+                                       response_renderer));
     EXPECT_FALSE(xfrout.isConnected());
 }
 
@@ -542,8 +542,8 @@
                         RRType::SOA());
     request_message.setHeaderFlag(MessageFlag::AA());
     createRequestPacket(IPPROTO_UDP);
-    EXPECT_EQ(true, server.processMessage(*io_message, parse_message,
-                                          response_renderer));
+    EXPECT_TRUE(server.processMessage(*io_message, parse_message,
+                                      response_renderer));
 
     // An internal command message should have been created and sent to an
     // external module.  Check them.
@@ -574,8 +574,8 @@
                         RRType::SOA());
     request_message.setHeaderFlag(MessageFlag::AA());
     createRequestPacket(IPPROTO_UDP);
-    EXPECT_EQ(true, server.processMessage(*io_message, parse_message,
-                                          response_renderer));
+    EXPECT_TRUE(server.processMessage(*io_message, parse_message,
+                                      response_renderer));
 
     // Other conditions should be the same, so simply confirm the RR class is
     // set correctly.
@@ -592,8 +592,8 @@
     request_message.setQid(default_qid);
     request_message.toWire(request_renderer);
     createRequestPacket(IPPROTO_UDP);
-    EXPECT_EQ(true, server.processMessage(*io_message, parse_message,
-                                          response_renderer));
+    EXPECT_TRUE(server.processMessage(*io_message, parse_message,
+                                      response_renderer));
     headerCheck(parse_message, default_qid, Rcode::FORMERR(),
                 Opcode::NOTIFY().getCode(), QR_FLAG, 0, 0, 0, 0);
 }
@@ -606,8 +606,8 @@
                                          RRType::SOA()));
     request_message.setHeaderFlag(MessageFlag::AA());
     createRequestPacket(IPPROTO_UDP);
-    EXPECT_EQ(true, server.processMessage(*io_message, parse_message,
-                                          response_renderer));
+    EXPECT_TRUE(server.processMessage(*io_message, parse_message,
+                                      response_renderer));
     headerCheck(parse_message, default_qid, Rcode::FORMERR(),
                 Opcode::NOTIFY().getCode(), QR_FLAG, 2, 0, 0, 0);
 }
@@ -617,8 +617,8 @@
                         RRType::NS());
     request_message.setHeaderFlag(MessageFlag::AA());
     createRequestPacket(IPPROTO_UDP);
-    EXPECT_EQ(true, server.processMessage(*io_message, parse_message,
-                                          response_renderer));
+    EXPECT_TRUE(server.processMessage(*io_message, parse_message,
+                                      response_renderer));
     headerCheck(parse_message, default_qid, Rcode::FORMERR(),
                 Opcode::NOTIFY().getCode(), QR_FLAG, 1, 0, 0, 0);
 }
@@ -627,8 +627,8 @@
     // implicitly leave the AA bit off.  our implementation will accept it.
     createRequestPacket(Opcode::NOTIFY(), Name("example.com"), RRClass::IN(),
                         RRType::SOA());
-    EXPECT_EQ(true, server.processMessage(*io_message, parse_message,
-                                          response_renderer));
+    EXPECT_TRUE(server.processMessage(*io_message, parse_message,
+                                      response_renderer));
     headerCheck(parse_message, default_qid, Rcode::NOERROR(),
                 Opcode::NOTIFY().getCode(), QR_FLAG | AA_FLAG, 1, 0, 0, 0);
 }
@@ -639,8 +639,8 @@
     request_message.setHeaderFlag(MessageFlag::AA());
     request_message.setRcode(Rcode::SERVFAIL());
     createRequestPacket(IPPROTO_UDP);
-    EXPECT_EQ(true, server.processMessage(*io_message, parse_message,
-                                          response_renderer));
+    EXPECT_TRUE(server.processMessage(*io_message, parse_message,
+                                      response_renderer));
     headerCheck(parse_message, default_qid, Rcode::NOERROR(),
                 Opcode::NOTIFY().getCode(), QR_FLAG | AA_FLAG, 1, 0, 0, 0);
 }
@@ -727,8 +727,8 @@
     // response should have the AA flag on, and have an RR in each answer
     // and authority section.
     createDataFromFile("examplequery_fromWire.wire");
-    EXPECT_EQ(true, server.processMessage(*io_message, parse_message,
-                                          response_renderer));
+    EXPECT_TRUE(server.processMessage(*io_message, parse_message,
+                                      response_renderer));
     headerCheck(parse_message, default_qid, Rcode::NOERROR(), opcode.getCode(),
                 QR_FLAG | AA_FLAG, 1, 1, 1, 0);
 }
@@ -741,8 +741,8 @@
     // in a SERVFAIL response, and the answer and authority sections should
     // be empty.
     createDataFromFile("badExampleQuery_fromWire.wire");
-    EXPECT_EQ(true, server.processMessage(*io_message, parse_message,
-                                          response_renderer));
+    EXPECT_TRUE(server.processMessage(*io_message, parse_message,
+                                      response_renderer));
     headerCheck(parse_message, default_qid, Rcode::SERVFAIL(),
                 opcode.getCode(), QR_FLAG, 1, 0, 0, 0);
 }
@@ -756,8 +756,8 @@
 
     // The original data source should still exist.
     createDataFromFile("examplequery_fromWire.wire");
-    EXPECT_EQ(true, server.processMessage(*io_message, parse_message,
-                                          response_renderer));
+    EXPECT_TRUE(server.processMessage(*io_message, parse_message,
+                                      response_renderer));
     headerCheck(parse_message, default_qid, Rcode::NOERROR(), opcode.getCode(),
                 QR_FLAG | AA_FLAG, 1, 1, 1, 0);
 }

Modified: trunk/src/bin/host/Makefile.am
==============================================================================
--- trunk/src/bin/host/Makefile.am (original)
+++ trunk/src/bin/host/Makefile.am Thu Oct 28 08:37:28 2010
@@ -1,5 +1,6 @@
 AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
 AM_CPPFLAGS += -I$(top_srcdir)/src/lib/dns -I$(top_builddir)/src/lib/dns
+AM_CPPFLAGS += $(BOOST_INCLUDES)
 
 AM_CXXFLAGS = $(B10_CXXFLAGS)
 

Modified: trunk/src/lib/bench/Makefile.am
==============================================================================
--- trunk/src/lib/bench/Makefile.am (original)
+++ trunk/src/lib/bench/Makefile.am Thu Oct 28 08:37:28 2010
@@ -1,6 +1,7 @@
 SUBDIRS = . tests example
 
 AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
+AM_CPPFLAGS += $(BOOST_INCLUDES)
 AM_CXXFLAGS = $(B10_CXXFLAGS)
 
 CLEANFILES = *.gcno *.gcda

Modified: trunk/src/lib/bench/example/search_bench.cc
==============================================================================
--- trunk/src/lib/bench/example/search_bench.cc (original)
+++ trunk/src/lib/bench/example/search_bench.cc Thu Oct 28 08:37:28 2010
@@ -16,6 +16,7 @@
 
 #include <unistd.h>             // for getpid
 
+#include <cassert>
 #include <cstdlib>              // for rand
 #include <algorithm>
 #include <iostream>
@@ -42,9 +43,11 @@
         vector<int>::const_iterator end_key = keys_.end();
         for (iter = keys_.begin(); iter != end_key; ++iter) {
             if (Sorted) {
-                binary_search(data_.begin(), data_.end(), *iter);
+                // perform simple sanity check with assert() to ensure
+                // compiler optimization won't skip the search.
+                assert(binary_search(data_.begin(), data_.end(), *iter));
             } else {
-                find(data_.begin(), data_.end(), *iter);
+                assert(find(data_.begin(), data_.end(), *iter) != data_.end());
             }
         }
         return (keys_.size());
@@ -63,7 +66,7 @@
         vector<int>::const_iterator iter;
         vector<int>::const_iterator end_key = keys_.end();
         for (iter = keys_.begin(); iter != end_key; ++iter) {
-            data_.find(*iter);
+            assert(data_.find(*iter) != data_.end());
         }        
         return (keys_.size());
     }

Modified: trunk/src/lib/bench/tests/Makefile.am
==============================================================================
--- trunk/src/lib/bench/tests/Makefile.am (original)
+++ trunk/src/lib/bench/tests/Makefile.am Thu Oct 28 08:37:28 2010
@@ -1,4 +1,5 @@
 AM_CPPFLAGS = -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib
+AM_CPPFLAGS += $(BOOST_INCLUDES)
 AM_CPPFLAGS += -DTEST_DATA_DIR=\"$(srcdir)/testdata\"
 AM_CXXFLAGS = $(B10_CXXFLAGS)
 

Modified: trunk/src/lib/cc/Makefile.am
==============================================================================
--- trunk/src/lib/cc/Makefile.am (original)
+++ trunk/src/lib/cc/Makefile.am Thu Oct 28 08:37:28 2010
@@ -1,15 +1,22 @@
 SUBDIRS = . tests
 
 AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
+AM_CPPFLAGS += $(BOOST_INCLUDES)
 AM_CPPFLAGS += -I$(top_srcdir)/src/lib/dns -I$(top_builddir)/src/lib/dns
 
 AM_CXXFLAGS = $(B10_CXXFLAGS)
-# ASIO header files used in session.cc will trigger "unused-parameter"
-# error.  Unfortunately there doesn't seem to be an easy way to selectively
+if USE_GXX
+# ASIO header files used in session.cc will trigger the "unused-parameter"
+# warning.  Unfortunately there doesn't seem to be an easy way to selectively
 # avoid the error.  As a short term workaround we suppress this warning
 # for the entire this module.  See also src/bin/auth/Makefile.am.
-if USE_GXX
 AM_CXXFLAGS += -Wno-unused-parameter
+endif
+if USE_CLANGPP
+# Likewise, ASIO header files will trigger various warnings with clang++.
+# Worse, there doesn't seem to be any option to disable one of the warnings
+# in any way, so we need to turn off -Werror.
+AM_CXXFLAGS += -Wno-error
 endif
 
 lib_LTLIBRARIES = libcc.la

Modified: trunk/src/lib/cc/tests/Makefile.am
==============================================================================
--- trunk/src/lib/cc/tests/Makefile.am (original)
+++ trunk/src/lib/cc/tests/Makefile.am Thu Oct 28 08:37:28 2010
@@ -1,9 +1,13 @@
 AM_CPPFLAGS = -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib
+AM_CPPFLAGS += $(BOOST_INCLUDES)
 AM_CPPFLAGS += -I$(top_srcdir)/src/lib/dns -I$(top_builddir)/src/lib/dns
 
 AM_CXXFLAGS = $(B10_CXXFLAGS)
 if USE_GXX			#XXX: see ../Makefile.am
 AM_CXXFLAGS += -Wno-unused-parameter
+endif
+if USE_CLANGPP
+AM_CXXFLAGS += -Wno-error
 endif
 
 if USE_STATIC_LINK

Modified: trunk/src/lib/cc/tests/data_unittests.cc
==============================================================================
--- trunk/src/lib/cc/tests/data_unittests.cc (original)
+++ trunk/src/lib/cc/tests/data_unittests.cc Thu Oct 28 08:37:28 2010
@@ -247,7 +247,7 @@
     EXPECT_EQ(b, true);
     b = false;
     EXPECT_TRUE(el->setValue(b));
-    EXPECT_EQ(false, el->boolValue());
+    EXPECT_FALSE(el->boolValue());
 
     el = Element::create("foo");
     EXPECT_THROW(el->intValue(), TypeError);

Modified: trunk/src/lib/config/Makefile.am
==============================================================================
--- trunk/src/lib/config/Makefile.am (original)
+++ trunk/src/lib/config/Makefile.am Thu Oct 28 08:37:28 2010
@@ -2,6 +2,7 @@
 
 AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
 AM_CPPFLAGS += -I$(top_builddir)/src/lib/cc
+AM_CPPFLAGS += $(BOOST_INCLUDES)
 AM_CXXFLAGS = $(B10_CXXFLAGS) -Wno-strict-aliasing
 
 lib_LTLIBRARIES = libcfgclient.la

Modified: trunk/src/lib/config/tests/Makefile.am
==============================================================================
--- trunk/src/lib/config/tests/Makefile.am (original)
+++ trunk/src/lib/config/tests/Makefile.am Thu Oct 28 08:37:28 2010
@@ -1,6 +1,7 @@
 SUBDIRS = testdata .
 
 AM_CPPFLAGS = -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib
+AM_CPPFLAGS += $(BOOST_INCLUDES)
 
 AM_CXXFLAGS = $(B10_CXXFLAGS)
 # see src/lib/cc/Makefile.am for -Wno-unused-parameter

Modified: trunk/src/lib/config/tests/ccsession_unittests.cc
==============================================================================
--- trunk/src/lib/config/tests/ccsession_unittests.cc (original)
+++ trunk/src/lib/config/tests/ccsession_unittests.cc Thu Oct 28 08:37:28 2010
@@ -150,9 +150,9 @@
 }
 
 TEST_F(CCSessionTest, session1) {
-    EXPECT_EQ(false, session.haveSubscription("Spec1", "*"));
+    EXPECT_FALSE(session.haveSubscription("Spec1", "*"));
     ModuleCCSession mccs(ccspecfile("spec1.spec"), session, NULL, NULL);
-    EXPECT_EQ(true, session.haveSubscription("Spec1", "*"));
+    EXPECT_TRUE(session.haveSubscription("Spec1", "*"));
 
     EXPECT_EQ(1, session.getMsgQueue()->size());
     ConstElementPtr msg;
@@ -165,9 +165,9 @@
 }
 
 TEST_F(CCSessionTest, session2) {
-    EXPECT_EQ(false, session.haveSubscription("Spec2", "*"));
+    EXPECT_FALSE(session.haveSubscription("Spec2", "*"));
     ModuleCCSession mccs(ccspecfile("spec2.spec"), session, NULL, NULL);
-    EXPECT_EQ(true, session.haveSubscription("Spec2", "*"));
+    EXPECT_TRUE(session.haveSubscription("Spec2", "*"));
 
     EXPECT_EQ(1, session.getMsgQueue()->size());
     ConstElementPtr msg;
@@ -211,10 +211,10 @@
     // client will ask for config
     session.getMessages()->add(createAnswer(0, el("{}")));
 
-    EXPECT_EQ(false, session.haveSubscription("Spec2", "*"));
+    EXPECT_FALSE(session.haveSubscription("Spec2", "*"));
     ModuleCCSession mccs(ccspecfile("spec2.spec"), session, my_config_handler,
                          my_command_handler);
-    EXPECT_EQ(true, session.haveSubscription("Spec2", "*"));
+    EXPECT_TRUE(session.haveSubscription("Spec2", "*"));
 
     EXPECT_EQ(2, session.getMsgQueue()->size());
     ConstElementPtr msg;
@@ -235,10 +235,10 @@
     // client will ask for config
     session.getMessages()->add(createAnswer(0, el("{}")));
 
-    EXPECT_EQ(false, session.haveSubscription("Spec2", "*"));
+    EXPECT_FALSE(session.haveSubscription("Spec2", "*"));
     ModuleCCSession mccs(ccspecfile("spec2.spec"), session, my_config_handler,
                          my_command_handler);
-    EXPECT_EQ(true, session.haveSubscription("Spec2", "*"));
+    EXPECT_TRUE(session.haveSubscription("Spec2", "*"));
 
     EXPECT_EQ(2, session.getMsgQueue()->size());
     ConstElementPtr msg;
@@ -340,23 +340,23 @@
     int item1;
     
     ModuleCCSession mccs(ccspecfile("spec1.spec"), session, NULL, NULL);
-    EXPECT_EQ(true, session.haveSubscription("Spec1", "*"));
+    EXPECT_TRUE(session.haveSubscription("Spec1", "*"));
     
     // first simply connect, with no config values, and see we get
     // the default
     session.getMessages()->add(createAnswer(0, el("{}")));
 
-    EXPECT_EQ(false, session.haveSubscription("Spec2", "*"));
+    EXPECT_FALSE(session.haveSubscription("Spec2", "*"));
     module_name = mccs.addRemoteConfig(ccspecfile("spec2.spec"));
     EXPECT_EQ("Spec2", module_name);
-    EXPECT_EQ(true, session.haveSubscription("Spec2", "*"));
+    EXPECT_TRUE(session.haveSubscription("Spec2", "*"));
 
     item1 = mccs.getRemoteConfigValue(module_name, "item1")->intValue();
     EXPECT_EQ(1, item1);
 
     // Remove it and see we get an error asking for a config value
     mccs.removeRemoteConfig(module_name);
-    EXPECT_EQ(false, session.haveSubscription("Spec2", "*"));
+    EXPECT_FALSE(session.haveSubscription("Spec2", "*"));
     EXPECT_THROW(mccs.getRemoteConfigValue(module_name, "item1"), CCSessionError);
 
     // Now re-add it, with a specific config value, and see we get that
@@ -387,9 +387,9 @@
     // client will ask for config
     session.getMessages()->add(createAnswer(0, el("{  }")));
 
-    EXPECT_EQ(false, session.haveSubscription("Spec2", "*"));
+    EXPECT_FALSE(session.haveSubscription("Spec2", "*"));
     ModuleCCSession mccs(ccspecfile("spec2.spec"), session, my_config_handler, my_command_handler);
-    EXPECT_EQ(true, session.haveSubscription("Spec2", "*"));
+    EXPECT_TRUE(session.haveSubscription("Spec2", "*"));
 
     EXPECT_EQ(2, session.getMsgQueue()->size());
     ConstElementPtr msg;

Modified: trunk/src/lib/datasrc/Makefile.am
==============================================================================
--- trunk/src/lib/datasrc/Makefile.am (original)
+++ trunk/src/lib/datasrc/Makefile.am Thu Oct 28 08:37:28 2010
@@ -2,6 +2,7 @@
 
 AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
 AM_CPPFLAGS += -I$(top_srcdir)/src/lib/dns -I$(top_builddir)/src/lib/dns
+AM_CPPFLAGS += $(BOOST_INCLUDES)
 AM_CPPFLAGS += $(SQLITE_CFLAGS)
 
 AM_CXXFLAGS = $(B10_CXXFLAGS)

Modified: trunk/src/lib/datasrc/tests/Makefile.am
==============================================================================
--- trunk/src/lib/datasrc/tests/Makefile.am (original)
+++ trunk/src/lib/datasrc/tests/Makefile.am Thu Oct 28 08:37:28 2010
@@ -1,5 +1,6 @@
 AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
 AM_CPPFLAGS += -I$(top_builddir)/src/lib/dns -I$(top_srcdir)/src/lib/dns
+AM_CPPFLAGS += $(BOOST_INCLUDES)
 AM_CPPFLAGS += -DTEST_DATA_DIR=\"$(srcdir)/testdata\"
 
 AM_CXXFLAGS = $(B10_CXXFLAGS)

Modified: trunk/src/lib/dns/Makefile.am
==============================================================================
--- trunk/src/lib/dns/Makefile.am (original)
+++ trunk/src/lib/dns/Makefile.am Thu Oct 28 08:37:28 2010
@@ -1,6 +1,7 @@
 SUBDIRS = . tests python
 
 AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
+AM_CPPFLAGS += $(BOOST_INCLUDES)
 AM_CXXFLAGS = $(B10_CXXFLAGS)
 
 CLEANFILES = *.gcno *.gcda

Modified: trunk/src/lib/dns/python/Makefile.am
==============================================================================
--- trunk/src/lib/dns/python/Makefile.am (original)
+++ trunk/src/lib/dns/python/Makefile.am Thu Oct 28 08:37:28 2010
@@ -1,6 +1,7 @@
 SUBDIRS = . tests
 
 AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
+AM_CPPFLAGS += $(BOOST_INCLUDES)
 AM_CXXFLAGS = $(B10_CXXFLAGS)
 
 pyexec_LTLIBRARIES = pydnspp.la

Modified: trunk/src/lib/dns/rdata/generic/opt_41.cc
==============================================================================
--- trunk/src/lib/dns/rdata/generic/opt_41.cc (original)
+++ trunk/src/lib/dns/rdata/generic/opt_41.cc Thu Oct 28 08:37:28 2010
@@ -65,7 +65,8 @@
 int
 OPT::compare(const Rdata& other) const {
     //const OPT& other_opt = dynamic_cast<const OPT&>(other);
-    dynamic_cast<const OPT&>(other); // right now we don't need other_opt
+    // right now we don't need other_opt:
+    static_cast<void>(dynamic_cast<const OPT&>(other));
 
     return (0);
 }

Modified: trunk/src/lib/dns/tests/Makefile.am
==============================================================================
--- trunk/src/lib/dns/tests/Makefile.am (original)
+++ trunk/src/lib/dns/tests/Makefile.am Thu Oct 28 08:37:28 2010
@@ -1,6 +1,7 @@
 SUBDIRS = testdata .
 
 AM_CPPFLAGS = -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib
+AM_CPPFLAGS += $(BOOST_INCLUDES)
 AM_CPPFLAGS += -I$(top_srcdir)/src/lib/dns -I$(top_builddir)/src/lib/dns
 AM_CPPFLAGS += -DTEST_DATA_SRCDIR=\"$(srcdir)/testdata\"
 AM_CPPFLAGS += -DTEST_DATA_BUILDDIR=\"$(abs_top_builddir)/src/lib/dns/tests/testdata\"

Modified: trunk/src/lib/dns/tests/name_unittest.cc
==============================================================================
--- trunk/src/lib/dns/tests/name_unittest.cc (original)
+++ trunk/src/lib/dns/tests/name_unittest.cc Thu Oct 28 08:37:28 2010
@@ -348,8 +348,8 @@
 
     UnitTestUtil::readWireData(string("01610376697803636f6d00"), data);
     Name("a.vix.com.").toWire(buffer);
-    EXPECT_EQ(true, buffer.getLength() == data.size() &&
-              memcmp(buffer.getData(), &data[0], data.size()) == 0);
+    EXPECT_PRED_FORMAT4(UnitTestUtil::matchWireData, &data[0], data.size(),
+                        buffer.getData(), buffer.getLength());
 }
 
 //
@@ -363,8 +363,8 @@
 
     UnitTestUtil::readWireData(string("01610376697803636f6d00"), data);
     Name("a.vix.com.").toWire(renderer);
-    EXPECT_EQ(true, buffer.getLength() == data.size() &&
-              memcmp(buffer.getData(), &data[0], data.size()) == 0);
+    EXPECT_PRED_FORMAT4(UnitTestUtil::matchWireData, &data[0], data.size(),
+                        buffer.getData(), buffer.getLength());
 }
 
 //
@@ -434,9 +434,9 @@
 }
 
 TEST_F(NameTest, isWildcard) {
-    EXPECT_EQ(false, example_name.isWildcard());
-    EXPECT_EQ(true, Name("*.a.example.com").isWildcard());
-    EXPECT_EQ(false, Name("a.*.example.com").isWildcard());
+    EXPECT_FALSE(example_name.isWildcard());
+    EXPECT_TRUE(Name("*.a.example.com").isWildcard());
+    EXPECT_FALSE(Name("a.*.example.com").isWildcard());
 }
 
 TEST_F(NameTest, concatenate) {

Modified: trunk/src/lib/dns/tests/rdata_ns_unittest.cc
==============================================================================
--- trunk/src/lib/dns/tests/rdata_ns_unittest.cc (original)
+++ trunk/src/lib/dns/tests/rdata_ns_unittest.cc Thu Oct 28 08:37:28 2010
@@ -112,7 +112,7 @@
 TEST_F(Rdata_NS_Test, compare) {
     generic::NS small("a.example");
     generic::NS large("example");
-    EXPECT_EQ(true, Name("a.example") > Name("example"));
+    EXPECT_TRUE(Name("a.example") > Name("example"));
     EXPECT_GT(0, small.compare(large));
 }
 

Modified: trunk/src/lib/dns/tests/rdata_ptr_unittest.cc
==============================================================================
--- trunk/src/lib/dns/tests/rdata_ptr_unittest.cc (original)
+++ trunk/src/lib/dns/tests/rdata_ptr_unittest.cc Thu Oct 28 08:37:28 2010
@@ -116,7 +116,7 @@
 TEST_F(Rdata_PTR_Test, compare) {
     generic::PTR small("a.example");
     generic::PTR large("example");
-    EXPECT_EQ(true, Name("a.example") > Name("example"));
+    EXPECT_TRUE(Name("a.example") > Name("example"));
     EXPECT_GT(0, small.compare(large));
 }
 

Modified: trunk/src/lib/dns/tests/rdata_unittest.cc
==============================================================================
--- trunk/src/lib/dns/tests/rdata_unittest.cc (original)
+++ trunk/src/lib/dns/tests/rdata_unittest.cc Thu Oct 28 08:37:28 2010
@@ -283,7 +283,7 @@
 
     // Check the case where the order is different from the owner name
     // comparison:
-    EXPECT_EQ(true, small > large);
+    EXPECT_TRUE(small > large);
     EXPECT_EQ(-1, compareNames(small, large));
     EXPECT_EQ(1, compareNames(large, small));
 

Modified: trunk/src/lib/xfr/Makefile.am
==============================================================================
--- trunk/src/lib/xfr/Makefile.am (original)
+++ trunk/src/lib/xfr/Makefile.am Thu Oct 28 08:37:28 2010
@@ -1,8 +1,12 @@
 AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
 AM_CPPFLAGS += -I$(top_srcdir)/src/lib/dns -I$(top_builddir)/src/lib/dns
+AM_CPPFLAGS += $(BOOST_INCLUDES)
 
 AM_CXXFLAGS = $(B10_CXXFLAGS) -Wno-strict-aliasing
 AM_CXXFLAGS += -Wno-unused-parameter # see src/lib/cc/Makefile.am
+if USE_CLANGPP
+AM_CXXFLAGS += -Wno-error
+endif
 
 CLEANFILES = *.gcno *.gcda
 




More information about the bind10-changes mailing list