[svn] commit: r3889 - in /branches/trac397focused: ./ src/bin/bind10/ src/bin/msgq/tests/ src/lib/nsas/ src/lib/nsas/tests/
BIND 10 source code commits
bind10-changes at lists.isc.org
Mon Dec 20 18:11:22 UTC 2010
Author: jinmei
Date: Mon Dec 20 18:11:22 2010
New Revision: 3889
Log:
more sync with trunk
Modified:
branches/trac397focused/ (props changed)
branches/trac397focused/configure.ac
branches/trac397focused/src/bin/bind10/bind10.py.in (props changed)
branches/trac397focused/src/bin/msgq/tests/Makefile.am
branches/trac397focused/src/bin/msgq/tests/msgq_test.py
branches/trac397focused/src/lib/nsas/ (props changed)
branches/trac397focused/src/lib/nsas/address_entry.cc
branches/trac397focused/src/lib/nsas/hash_key.h
branches/trac397focused/src/lib/nsas/hash_table.h
branches/trac397focused/src/lib/nsas/lru_list.h
branches/trac397focused/src/lib/nsas/nameserver_address.cc
branches/trac397focused/src/lib/nsas/nameserver_address_store.cc
branches/trac397focused/src/lib/nsas/nameserver_entry.cc
branches/trac397focused/src/lib/nsas/nameserver_entry.h
branches/trac397focused/src/lib/nsas/tests/ (props changed)
branches/trac397focused/src/lib/nsas/tests/address_entry_unittest.cc
branches/trac397focused/src/lib/nsas/tests/fetchable_unittest.cc
branches/trac397focused/src/lib/nsas/tests/hash_deleter_unittest.cc
branches/trac397focused/src/lib/nsas/tests/hash_key_unittest.cc
branches/trac397focused/src/lib/nsas/tests/hash_table_unittest.cc
branches/trac397focused/src/lib/nsas/tests/hash_unittest.cc
branches/trac397focused/src/lib/nsas/tests/lru_list_unittest.cc
branches/trac397focused/src/lib/nsas/tests/nameserver_address_store_unittest.cc
branches/trac397focused/src/lib/nsas/tests/nameserver_address_unittest.cc
branches/trac397focused/src/lib/nsas/tests/nameserver_entry_unittest.cc
branches/trac397focused/src/lib/nsas/tests/nsas_entry_compare_unittest.cc
branches/trac397focused/src/lib/nsas/tests/random_number_generator_unittest.cc
branches/trac397focused/src/lib/nsas/tests/run_unittests.cc
branches/trac397focused/src/lib/nsas/tests/zone_entry_unittest.cc
branches/trac397focused/src/lib/nsas/zone_entry.cc
branches/trac397focused/src/lib/nsas/zone_entry.h
Modified: branches/trac397focused/configure.ac
==============================================================================
--- branches/trac397focused/configure.ac (original)
+++ branches/trac397focused/configure.ac Mon Dec 20 18:11:22 2010
@@ -195,14 +195,15 @@
# specify the default warning flags in CXXFLAGS and let specific modules
# "override" the default.
-# This may be used to try compiler flags.
+# This may be used to try linker flags.
AC_DEFUN([BIND10_CXX_TRY_FLAG], [
AC_MSG_CHECKING([whether $CXX supports $1])
bind10_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS $1"
- AC_COMPILE_IFELSE([ ], [bind10_cxx_flag=yes], [bind10_cxx_flag=no])
+ AC_LINK_IFELSE([int main(void){ return 0;} ],
+ [bind10_cxx_flag=yes], [bind10_cxx_flag=no])
CXXFLAGS="$bind10_save_CXXFLAGS"
if test "x$bind10_cxx_flag" = "xyes"; then
@@ -367,13 +368,31 @@
LIBS_SAVES="$LIBS"
CPPFLAGS="$BOOST_INCLUDES $CPPFLAGS $MULTITHREADING_FLAG"
need_libboost_thread=0
+need_sunpro_workaround=0
AC_TRY_LINK([
#include <boost/thread.hpp>
],[
boost::mutex m;
],
[ AC_MSG_RESULT(yes (without libboost_thread)) ],
- [ LIBS=" $LIBS -lboost_thread"
+
+ # there is one specific problem with SunStudio 5.10
+ # where including boost/thread causes a compilation failure
+ # There is a workaround in boost but it checks the version not being 5.10
+ # This will probably be fixed in the future, in which case this
+ # is only a temporary workaround
+ [ AC_TRY_LINK([
+#if defined(__SUNPRO_CC) && __SUNPRO_CC == 0x5100
+#undef __SUNPRO_CC
+#define __SUNPRO_CC 0x5090
+#endif
+#include <boost/thread.hpp>
+],[
+boost::mutex m;
+],
+ [ AC_MSG_RESULT(yes (with SUNOS workaround))
+ need_sunpro_workaround=1 ],
+ [ LIBS=" $LIBS -lboost_thread"
AC_TRY_LINK([
#include <boost/thread.hpp>
],[
@@ -385,10 +404,13 @@
AC_MSG_ERROR([boost::mutex cannot be linked in this build environment.
Perhaps you are using an older version of Boost that requires libboost_thread for the mutex support, which does not appear to be available.
You may want to check the availability of the library or to upgrade Boost.])
- ])])
+ ])])])
CPPFLAGS="$CPPFLAGS_SAVES"
LIBS="$LIBS_SAVES"
AM_CONDITIONAL(NEED_LIBBOOST_THREAD, test $need_libboost_thread = 1)
+if test $need_sunpro_workaround = 1; then
+ AC_DEFINE([NEED_SUNPRO_WORKAROUND], [], [Need boost sunstudio workaround])
+fi
#
# Check availability of gtest, which will be used for unit tests.
Modified: branches/trac397focused/src/bin/msgq/tests/Makefile.am
==============================================================================
--- branches/trac397focused/src/bin/msgq/tests/Makefile.am (original)
+++ branches/trac397focused/src/bin/msgq/tests/Makefile.am Mon Dec 20 18:11:22 2010
@@ -8,6 +8,7 @@
for pytest in $(PYTESTS) ; do \
echo Running test: $$pytest ; \
env PYTHONPATH=$(abs_top_builddir)/src/bin/msgq:$(abs_top_srcdir)/src/lib/python:$(abs_top_builddir)/src/lib/python \
+ BIND10_TEST_SOCKET_FILE=$(builddir)/test_msgq_socket.sock \
$(PYCOVERAGE) $(abs_srcdir)/$$pytest || exit ; \
done
Modified: branches/trac397focused/src/bin/msgq/tests/msgq_test.py
==============================================================================
--- branches/trac397focused/src/bin/msgq/tests/msgq_test.py (original)
+++ branches/trac397focused/src/bin/msgq/tests/msgq_test.py Mon Dec 20 18:11:22 2010
@@ -79,9 +79,14 @@
def test_open_socket_default(self):
env_var = None
+ orig_socket_file = None
if "BIND10_MSGQ_SOCKET_FILE" in os.environ:
env_var = os.environ["BIND10_MSGQ_SOCKET_FILE"]
del os.environ["BIND10_MSGQ_SOCKET_FILE"]
+ # temporarily replace the class "default" not to be disrupted by
+ # any running BIND 10 instance.
+ if "BIND10_TEST_SOCKET_FILE" in os.environ:
+ MsgQ.SOCKET_FILE = os.environ["BIND10_TEST_SOCKET_FILE"]
socket_file = MsgQ.SOCKET_FILE
self.assertFalse(os.path.exists(socket_file))
msgq = MsgQ();
@@ -96,6 +101,8 @@
pass
if env_var is not None:
os.environ["BIND10_MSGQ_SOCKET_FILE"] = env_var
+ if orig_socket_file is not None:
+ MsgQ.SOCKET_FILE = orig_socket_file
def test_open_socket_bad(self):
msgq = MsgQ("/does/not/exist")
Modified: branches/trac397focused/src/lib/nsas/address_entry.cc
==============================================================================
--- branches/trac397focused/src/lib/nsas/address_entry.cc (original)
+++ branches/trac397focused/src/lib/nsas/address_entry.cc Mon Dec 20 18:11:22 2010
@@ -35,6 +35,8 @@
#define __STDC_LIMIT_MACROS
#include <stdint.h>
+#include <config.h>
+
#include "address_entry.h"
namespace isc {
Modified: branches/trac397focused/src/lib/nsas/hash_key.h
==============================================================================
--- branches/trac397focused/src/lib/nsas/hash_key.h (original)
+++ branches/trac397focused/src/lib/nsas/hash_key.h Mon Dec 20 18:11:22 2010
@@ -21,7 +21,6 @@
#include <stdint.h>
#include <string>
-#include <config.h>
namespace isc {
namespace nsas {
Modified: branches/trac397focused/src/lib/nsas/hash_table.h
==============================================================================
--- branches/trac397focused/src/lib/nsas/hash_table.h (original)
+++ branches/trac397focused/src/lib/nsas/hash_table.h Mon Dec 20 18:11:22 2010
@@ -17,14 +17,24 @@
#ifndef __HASH_TABLE_H
#define __HASH_TABLE_H
+// Workaround for a problem with boost and sunstudio 5.10
+// There is a version check in there that appears wrong,
+// which makes including boost/thread.hpp fail
+// This will probably be fixed in a future version of boost,
+// in which case this part can be removed then
+#ifdef NEED_SUNPRO_WORKAROUND
+#if defined(__SUNPRO_CC) && __SUNPRO_CC == 0x5100
+#undef __SUNPRO_CC
+#define __SUNPRO_CC 0x5090
+#endif
+#endif // NEED_SUNPRO_WORKAROUND
+
#include <boost/shared_ptr.hpp>
#include <boost/thread.hpp>
#include <boost/interprocess/sync/sharable_lock.hpp>
#include <boost/interprocess/sync/scoped_lock.hpp>
#include <boost/interprocess/sync/interprocess_upgradable_mutex.hpp>
#include <list>
-
-#include <config.h>
#include "hash.h"
#include "hash_key.h"
Modified: branches/trac397focused/src/lib/nsas/lru_list.h
==============================================================================
--- branches/trac397focused/src/lib/nsas/lru_list.h (original)
+++ branches/trac397focused/src/lib/nsas/lru_list.h Mon Dec 20 18:11:22 2010
@@ -20,12 +20,22 @@
#include <list>
#include <string>
+// Workaround for a problem with boost and sunstudio 5.10
+// There is a version check in there that appears wrong,
+// which makes including boost/thread.hpp fail
+// This will probably be fixed in a future version of boost,
+// in which case this part can be removed then
+#ifdef NEED_SUNPRO_WORKAROUND
+#if defined(__SUNPRO_CC) && __SUNPRO_CC == 0x5100
+#undef __SUNPRO_CC
+#define __SUNPRO_CC 0x5090
+#endif
+#endif // NEED_SUNPRO_WORKAROUND
+
#include <boost/noncopyable.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/thread.hpp>
#include <boost/interprocess/sync/scoped_lock.hpp>
-
-#include <config.h>
namespace isc {
namespace nsas {
Modified: branches/trac397focused/src/lib/nsas/nameserver_address.cc
==============================================================================
--- branches/trac397focused/src/lib/nsas/nameserver_address.cc (original)
+++ branches/trac397focused/src/lib/nsas/nameserver_address.cc Mon Dec 20 18:11:22 2010
@@ -14,6 +14,8 @@
// $id$
+#include <config.h>
+
#include "nameserver_address.h"
#include "nameserver_entry.h"
Modified: branches/trac397focused/src/lib/nsas/nameserver_address_store.cc
==============================================================================
--- branches/trac397focused/src/lib/nsas/nameserver_address_store.cc (original)
+++ branches/trac397focused/src/lib/nsas/nameserver_address_store.cc Mon Dec 20 18:11:22 2010
@@ -13,6 +13,21 @@
// PERFORMANCE OF THIS SOFTWARE.
// $Id$
+
+#include <config.h>
+
+// Workaround for a problem with boost and sunstudio 5.10
+// There is a version check in there that appears wrong,
+// which makes including boost/thread.hpp fail
+// This will probably be fixed in a future version of boost,
+// in which case this part can be removed then
+#ifdef NEED_SUNPRO_WORKAROUND
+#if defined(__SUNPRO_CC) && __SUNPRO_CC == 0x5100
+#undef __SUNPRO_CC
+#define __SUNPRO_CC 0x5090
+#endif
+#endif // NEED_SUNPRO_WORKAROUND
+
#include <boost/thread.hpp>
#include <boost/shared_ptr.hpp>
Modified: branches/trac397focused/src/lib/nsas/nameserver_entry.cc
==============================================================================
--- branches/trac397focused/src/lib/nsas/nameserver_entry.cc (original)
+++ branches/trac397focused/src/lib/nsas/nameserver_entry.cc Mon Dec 20 18:11:22 2010
@@ -13,6 +13,8 @@
// PERFORMANCE OF THIS SOFTWARE.
// $Id$
+
+#include <config.h>
#include <algorithm>
#include <functional>
Modified: branches/trac397focused/src/lib/nsas/nameserver_entry.h
==============================================================================
--- branches/trac397focused/src/lib/nsas/nameserver_entry.h (original)
+++ branches/trac397focused/src/lib/nsas/nameserver_entry.h Mon Dec 20 18:11:22 2010
@@ -16,6 +16,18 @@
#ifndef __NAMESERVER_ENTRY_H
#define __NAMESERVER_ENTRY_H
+
+// Workaround for a problem with boost and sunstudio 5.10
+// There is a version check in there that appears wrong,
+// which makes including boost/thread.hpp fail
+// This will probably be fixed in a future version of boost,
+// in which case this part can be removed then
+#ifdef NEED_SUNPRO_WORKAROUND
+#if defined(__SUNPRO_CC) && __SUNPRO_CC == 0x5100
+#undef __SUNPRO_CC
+#define __SUNPRO_CC 0x5090
+#endif
+#endif // NEED_SUNPRO_WORKAROUND
#include <string>
#include <vector>
Modified: branches/trac397focused/src/lib/nsas/tests/address_entry_unittest.cc
==============================================================================
--- branches/trac397focused/src/lib/nsas/tests/address_entry_unittest.cc (original)
+++ branches/trac397focused/src/lib/nsas/tests/address_entry_unittest.cc Mon Dec 20 18:11:22 2010
@@ -13,6 +13,7 @@
// PERFORMANCE OF THIS SOFTWARE.
// $Id$
+#include <config.h>
#include <limits.h>
#include <gtest/gtest.h>
Modified: branches/trac397focused/src/lib/nsas/tests/fetchable_unittest.cc
==============================================================================
--- branches/trac397focused/src/lib/nsas/tests/fetchable_unittest.cc (original)
+++ branches/trac397focused/src/lib/nsas/tests/fetchable_unittest.cc Mon Dec 20 18:11:22 2010
@@ -13,6 +13,7 @@
// PERFORMANCE OF THIS SOFTWARE.
// $id$
+#include <config.h>
#include "../fetchable.h"
Modified: branches/trac397focused/src/lib/nsas/tests/hash_deleter_unittest.cc
==============================================================================
--- branches/trac397focused/src/lib/nsas/tests/hash_deleter_unittest.cc (original)
+++ branches/trac397focused/src/lib/nsas/tests/hash_deleter_unittest.cc Mon Dec 20 18:11:22 2010
@@ -13,6 +13,7 @@
// PERFORMANCE OF THIS SOFTWARE.
// $Id$
+#include <config.h>
#include <algorithm>
#include <string>
Modified: branches/trac397focused/src/lib/nsas/tests/hash_key_unittest.cc
==============================================================================
--- branches/trac397focused/src/lib/nsas/tests/hash_key_unittest.cc (original)
+++ branches/trac397focused/src/lib/nsas/tests/hash_key_unittest.cc Mon Dec 20 18:11:22 2010
@@ -13,6 +13,7 @@
// PERFORMANCE OF THIS SOFTWARE.
// $Id$
+#include <config.h>
#include <algorithm>
#include <string>
Modified: branches/trac397focused/src/lib/nsas/tests/hash_table_unittest.cc
==============================================================================
--- branches/trac397focused/src/lib/nsas/tests/hash_table_unittest.cc (original)
+++ branches/trac397focused/src/lib/nsas/tests/hash_table_unittest.cc Mon Dec 20 18:11:22 2010
@@ -13,6 +13,7 @@
// PERFORMANCE OF THIS SOFTWARE.
// $Id$
+#include <config.h>
#include <gtest/gtest.h>
#include <boost/shared_ptr.hpp>
Modified: branches/trac397focused/src/lib/nsas/tests/hash_unittest.cc
==============================================================================
--- branches/trac397focused/src/lib/nsas/tests/hash_unittest.cc (original)
+++ branches/trac397focused/src/lib/nsas/tests/hash_unittest.cc Mon Dec 20 18:11:22 2010
@@ -13,6 +13,7 @@
// PERFORMANCE OF THIS SOFTWARE.
// $Id$
+#include <config.h>
#include <algorithm>
#include <string>
Modified: branches/trac397focused/src/lib/nsas/tests/lru_list_unittest.cc
==============================================================================
--- branches/trac397focused/src/lib/nsas/tests/lru_list_unittest.cc (original)
+++ branches/trac397focused/src/lib/nsas/tests/lru_list_unittest.cc Mon Dec 20 18:11:22 2010
@@ -13,6 +13,7 @@
// PERFORMANCE OF THIS SOFTWARE.
// $Id$
+#include <config.h>
#include <iostream>
#include <algorithm>
Modified: branches/trac397focused/src/lib/nsas/tests/nameserver_address_store_unittest.cc
==============================================================================
--- branches/trac397focused/src/lib/nsas/tests/nameserver_address_store_unittest.cc (original)
+++ branches/trac397focused/src/lib/nsas/tests/nameserver_address_store_unittest.cc Mon Dec 20 18:11:22 2010
@@ -13,6 +13,7 @@
// PERFORMANCE OF THIS SOFTWARE.
// $Id$
+#include <config.h>
/// \brief Test Deleter Objects
///
Modified: branches/trac397focused/src/lib/nsas/tests/nameserver_address_unittest.cc
==============================================================================
--- branches/trac397focused/src/lib/nsas/tests/nameserver_address_unittest.cc (original)
+++ branches/trac397focused/src/lib/nsas/tests/nameserver_address_unittest.cc Mon Dec 20 18:11:22 2010
@@ -13,6 +13,7 @@
// PERFORMANCE OF THIS SOFTWARE.
// $Id$
+#include <config.h>
#include <gtest/gtest.h>
Modified: branches/trac397focused/src/lib/nsas/tests/nameserver_entry_unittest.cc
==============================================================================
--- branches/trac397focused/src/lib/nsas/tests/nameserver_entry_unittest.cc (original)
+++ branches/trac397focused/src/lib/nsas/tests/nameserver_entry_unittest.cc Mon Dec 20 18:11:22 2010
@@ -13,6 +13,7 @@
// PERFORMANCE OF THIS SOFTWARE.
// $Id$
+#include <config.h>
#include <iostream>
#include <algorithm>
Modified: branches/trac397focused/src/lib/nsas/tests/nsas_entry_compare_unittest.cc
==============================================================================
--- branches/trac397focused/src/lib/nsas/tests/nsas_entry_compare_unittest.cc (original)
+++ branches/trac397focused/src/lib/nsas/tests/nsas_entry_compare_unittest.cc Mon Dec 20 18:11:22 2010
@@ -13,6 +13,7 @@
// PERFORMANCE OF THIS SOFTWARE.
// $Id$
+#include <config.h>
#include <algorithm>
#include <string>
@@ -37,16 +38,18 @@
// Test of the comparison
TEST_F(NsasEntryCompareTest, Compare) {
+ std::string name1("test1");
+ std::string name2("test2");
// Construct a couple of different objects
- TestEntry entry1("test1", RRClass(42));
- TestEntry entry2("test1", RRClass(24));
- TestEntry entry3("test2", RRClass(42));
+ TestEntry entry1(name1, RRClass(42));
+ TestEntry entry2(name1, RRClass(24));
+ TestEntry entry3(name2, RRClass(42));
// Create corresponding hash key objects
- HashKey key1(entry1.getName(), entry1.getClass());
- HashKey key2(entry2.getName(), entry2.getClass());
- HashKey key3(entry3.getName(), entry3.getClass());
+ HashKey key1(name1, entry1.getClass());
+ HashKey key2(name1, entry2.getClass());
+ HashKey key3(name2, entry3.getClass());
// Perform the comparison
NsasEntryCompare<TestEntry> compare;
Modified: branches/trac397focused/src/lib/nsas/tests/random_number_generator_unittest.cc
==============================================================================
--- branches/trac397focused/src/lib/nsas/tests/random_number_generator_unittest.cc (original)
+++ branches/trac397focused/src/lib/nsas/tests/random_number_generator_unittest.cc Mon Dec 20 18:11:22 2010
@@ -13,6 +13,7 @@
// PERFORMANCE OF THIS SOFTWARE.
// $Id$
+#include <config.h>
#include <gtest/gtest.h>
#include <boost/shared_ptr.hpp>
Modified: branches/trac397focused/src/lib/nsas/tests/run_unittests.cc
==============================================================================
--- branches/trac397focused/src/lib/nsas/tests/run_unittests.cc (original)
+++ branches/trac397focused/src/lib/nsas/tests/run_unittests.cc Mon Dec 20 18:11:22 2010
@@ -13,6 +13,7 @@
// PERFORMANCE OF THIS SOFTWARE.
// $Id: run_unittests.cc 3020 2010-09-26 03:47:26Z jinmei $
+#include <config.h>
#include <gtest/gtest.h>
Modified: branches/trac397focused/src/lib/nsas/tests/zone_entry_unittest.cc
==============================================================================
--- branches/trac397focused/src/lib/nsas/tests/zone_entry_unittest.cc (original)
+++ branches/trac397focused/src/lib/nsas/tests/zone_entry_unittest.cc Mon Dec 20 18:11:22 2010
@@ -13,6 +13,7 @@
// PERFORMANCE OF THIS SOFTWARE.
// $Id$
+#include <config.h>
#include <gtest/gtest.h>
#include <boost/shared_ptr.hpp>
@@ -711,7 +712,7 @@
for (size_t i(0); i < 3; ++ i) {
double mu = repeats * ps[i];
double sigma = sqrt(repeats * ps[i] * (1 - ps[i]));
- ASSERT_TRUE(fabs(counts[i] - mu < 4 * sigma));
+ ASSERT_TRUE(fabs(counts[i] - mu) < 4 * sigma);
}
// reset the environment
Modified: branches/trac397focused/src/lib/nsas/zone_entry.cc
==============================================================================
--- branches/trac397focused/src/lib/nsas/zone_entry.cc (original)
+++ branches/trac397focused/src/lib/nsas/zone_entry.cc Mon Dec 20 18:11:22 2010
@@ -13,6 +13,8 @@
// PERFORMANCE OF THIS SOFTWARE.
// $id$
+
+#include <config.h>
#include "zone_entry.h"
#include "address_request_callback.h"
Modified: branches/trac397focused/src/lib/nsas/zone_entry.h
==============================================================================
--- branches/trac397focused/src/lib/nsas/zone_entry.h (original)
+++ branches/trac397focused/src/lib/nsas/zone_entry.h Mon Dec 20 18:11:22 2010
@@ -16,6 +16,18 @@
#ifndef __ZONE_ENTRY_H
#define __ZONE_ENTRY_H
+
+// Workaround for a problem with boost and sunstudio 5.10
+// There is a version check in there that appears wrong,
+// which makes including boost/thread.hpp fail
+// This will probably be fixed in a future version of boost,
+// in which case this part can be removed then
+#ifdef NEED_SUNPRO_WORKAROUND
+#if defined(__SUNPRO_CC) && __SUNPRO_CC == 0x5100
+#undef __SUNPRO_CC
+#define __SUNPRO_CC 0x5090
+#endif
+#endif // NEED_SUNPRO_WORKAROUND
#include <string>
#include <vector>
More information about the bind10-changes
mailing list