BIND 10 trac826, updated. f5facd5127f3dc508da24f12a475f8b816ff30a5 [trac826] fixed tests
BIND 10 source code commits
bind10-changes at lists.isc.org
Wed Oct 5 17:02:09 UTC 2011
The branch, trac826 has been updated
via f5facd5127f3dc508da24f12a475f8b816ff30a5 (commit)
from f4d59306f92a2b070025c8d19c3f8ba48814f689 (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 f5facd5127f3dc508da24f12a475f8b816ff30a5
Author: Francis Dupont <fdupont at isc.org>
Date: Wed Oct 5 19:01:58 2011 +0200
[trac826] fixed tests
fixed some other things including tests, updated nsas as a side effect.
-----------------------------------------------------------------------
Summary of changes:
WIN32-NOTES | 13 ++-----
src/lib/acl/tests/run_unittests.cc | 16 ++++++++
src/lib/asiodns/tests/io_fetch_unittest.cc | 19 ++++------
src/lib/asiolink/tests/io_endpoint_unittest.cc | 2 +-
src/lib/bench/tests/benchmark_unittest.cc | 2 +-
src/lib/cc/data.cc | 3 ++
src/lib/cc/data.h | 2 +-
src/lib/datasrc/tests/rbtree_unittest.cc | 3 +-
src/lib/dns/tests/edns_unittest.cc | 3 +-
src/lib/dns/tests/message_unittest.cc | 6 +--
src/lib/dns/tests/name_unittest.cc | 3 +-
src/lib/log/tests/logger_manager_unittest.cc | 2 +-
src/lib/log/tests/tempdir.h.win32 | 2 +-
src/lib/nsas/nameserver_address_store.cc | 6 +++
src/lib/nsas/nameserver_entry.cc | 26 +++++++++++--
.../{resolve/resolve_log.cc => nsas/nsas_log.cc} | 8 ++--
src/lib/{resolve/resolve_log.h => nsas/nsas_log.h} | 38 ++++++++++----------
src/lib/nsas/tests/Makefile.am | 6 ++-
src/lib/nsas/tests/run_unittests.cc | 10 ++---
src/lib/resolve/recursive_query.cc | 2 +
win32build/VS2010/libnsas/libnsas.vcxproj | 2 +
win32build/VS2010/libnsas/libnsas.vcxproj.filters | 6 +++
.../VS2010/libnsas_tests/libnsas_tests.vcxproj | 8 ++--
23 files changed, 113 insertions(+), 75 deletions(-)
copy src/lib/{resolve/resolve_log.cc => nsas/nsas_log.cc} (86%)
copy src/lib/{resolve/resolve_log.h => nsas/nsas_log.h} (58%)
-----------------------------------------------------------------------
diff --git a/WIN32-NOTES b/WIN32-NOTES
index 3da8199..81bed5d 100644
--- a/WIN32-NOTES
+++ b/WIN32-NOTES
@@ -157,12 +157,7 @@ Random notes (for porting new code):
- WSAStartup/WSACleanup in main()
Test status: (unittests failures)
- log: LoggerManagerTest* (2) (+crash in debug)
- cfgclient: LogConfigTest (1)
- acl: RequestCheckTest (3) IPAddress (2)
- bench: BenchMarkTest (1) (too long?)
- asiolink: IOEndpointTest.getSockAddr (debug crash)
- asiodns: IOFetchTest (19)
- cc: Element.removeIdentical (debug crash)
- resolve: *imeout* (+crash in debug)
- b10-dhcp6: interface stuff?
+ cfgclient: LogConfigTest (1) (environment related???)
+ resolve: *imeout* (+crash in debug, double delete? temporary fix...)
+ b10-dhcp6: can't work as Windows has no loopback interface...
+
diff --git a/src/lib/acl/tests/run_unittests.cc b/src/lib/acl/tests/run_unittests.cc
index 8dc59a2..a26d782 100644
--- a/src/lib/acl/tests/run_unittests.cc
+++ b/src/lib/acl/tests/run_unittests.cc
@@ -12,6 +12,12 @@
// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE.
+#include <config.h>
+
+#ifdef _WIN32
+#include <winsock2.h>
+#endif
+
#include <gtest/gtest.h>
#include <log/logger_support.h>
#include <util/unittests/run_all.h>
@@ -19,6 +25,16 @@
int
main(int argc, char* argv[]) {
::testing::InitGoogleTest(&argc, argv);
+
isc::log::initLogger();
+
+#ifdef _WIN32
+ WSADATA wsaData;
+ WSAStartup(MAKEWORD(2,2), &wsaData);
+ int ret = isc::util::unittests::run_all();
+ WSACleanup();
+ return (ret);
+#else
return (isc::util::unittests::run_all());
+#endif
}
diff --git a/src/lib/asiodns/tests/io_fetch_unittest.cc b/src/lib/asiodns/tests/io_fetch_unittest.cc
index 5b897f7..44df7b8 100644
--- a/src/lib/asiodns/tests/io_fetch_unittest.cc
+++ b/src/lib/asiodns/tests/io_fetch_unittest.cc
@@ -45,7 +45,7 @@
#ifdef _MSC_VER
#pragma warning(push)
-#pragma warning(disable: 4351)
+#pragma warning(disable: 4351, 4355)
#endif
using namespace asio;
@@ -111,9 +111,9 @@ public:
result_buff_(new OutputBuffer(512)),
msgbuf_(new OutputBuffer(512)),
udp_fetch_(IOFetch::UDP, service_, question_, IOAddress(TEST_HOST),
- TEST_PORT, result_buff_, NULL, 100),
+ TEST_PORT, result_buff_, this, 100),
tcp_fetch_(IOFetch::TCP, service_, question_, IOAddress(TEST_HOST),
- TEST_PORT, result_buff_, NULL, (16 * SEND_INTERVAL)),
+ TEST_PORT, result_buff_, this, (16 * SEND_INTERVAL)),
// Timeout interval chosen to ensure no timeout
protocol_(IOFetch::TCP), // for initialization - will be changed
cumulative_(0),
@@ -130,14 +130,6 @@ public:
qid_1(0),
tcp_short_send_(false)
{
- // use 'this'
- udp_fetch_ = IOFetch(IOFetch::UDP, service_,
- question_, IOAddress(TEST_HOST),
- TEST_PORT, result_buff_, this, 100);
- tcp_fetch_ = IOFetch(IOFetch::TCP, service_,
- question_, IOAddress(TEST_HOST),
- TEST_PORT, result_buff_, this, (16 * SEND_INTERVAL));
-
// Construct the data buffer for question we expect to receive.
Message msg(Message::RENDER);
msg.setQid(0);
@@ -145,6 +137,9 @@ public:
msg.setRcode(Rcode::NOERROR());
msg.setHeaderFlag(Message::HEADERFLAG_RD);
msg.addQuestion(question_);
+ EDNSPtr msg_edns(new EDNS());
+ msg_edns->setUDPSize(Message::DEFAULT_MAX_EDNS0_UDPSIZE);
+ msg.setEDNS(msg_edns);
MessageRenderer renderer(*msgbuf_);
msg.toWire(renderer);
MessageRenderer renderer2(*expected_buffer_);
@@ -234,7 +229,7 @@ public:
/// \param socket Socket on which data will be received
/// \param ec Boost error code, value should be zero.
void tcpAcceptHandler(tcp::socket* socket,
- asio::error_code ec = asio::error_code())
+ asio::error_code ec = asio::error_code())
{
if (debug_) {
cout << "tcpAcceptHandler(): error = " << ec.value() << endl;
diff --git a/src/lib/asiolink/tests/io_endpoint_unittest.cc b/src/lib/asiolink/tests/io_endpoint_unittest.cc
index 5e347a3..257a1a1 100644
--- a/src/lib/asiolink/tests/io_endpoint_unittest.cc
+++ b/src/lib/asiolink/tests/io_endpoint_unittest.cc
@@ -224,7 +224,7 @@ sockAddrMatch(const struct sockaddr& actual_sa,
res->ai_addr->sa_len = actual_sa.sa_len;
#endif
EXPECT_EQ(0, memcmp(res->ai_addr, &actual_sa, res->ai_addrlen));
- free(res);
+ freeaddrinfo(res);
}
TEST(IOEndpointTest, getSockAddr) {
diff --git a/src/lib/bench/tests/benchmark_unittest.cc b/src/lib/bench/tests/benchmark_unittest.cc
index 47f8997..5f62aad 100644
--- a/src/lib/bench/tests/benchmark_unittest.cc
+++ b/src/lib/bench/tests/benchmark_unittest.cc
@@ -100,7 +100,7 @@ TEST(BenchMarkTest, run) {
struct timeval check_begin, check_end;
gettimeofday(&check_begin, NULL);
#ifdef _WIN32
- Sleep((sleep_timespec.tv_sec * 1000) + (sleep_timespec.tv_nsec / 1000));
+ Sleep((sleep_timespec.tv_sec * 1000) + (sleep_timespec.tv_nsec / 1000000));
#else
nanosleep(&sleep_timespec, 0);
#endif
diff --git a/src/lib/cc/data.cc b/src/lib/cc/data.cc
index fe25d4f..c4feb4c 100644
--- a/src/lib/cc/data.cc
+++ b/src/lib/cc/data.cc
@@ -848,12 +848,15 @@ removeIdentical(ElementPtr a, ConstElementPtr b) {
isc_throw(TypeError, "Non-map Elements passed to removeIdentical");
}
+ again:
const std::map<std::string, ConstElementPtr>& m = a->mapValue();
for (std::map<std::string, ConstElementPtr>::const_iterator it = m.begin();
it != m.end() ; ++it) {
if (b->contains((*it).first)) {
if (a->get((*it).first)->equals(*b->get((*it).first))) {
a->remove((*it).first);
+ // temporary fix
+ goto again;
}
}
}
diff --git a/src/lib/cc/data.h b/src/lib/cc/data.h
index f9d5840..ed0d922 100644
--- a/src/lib/cc/data.h
+++ b/src/lib/cc/data.h
@@ -484,7 +484,7 @@ public:
return (true);
}
using Element::setValue;
- bool setValue(std::map<std::string, ConstElementPtr>& v) {
+ bool setValue(const std::map<std::string, ConstElementPtr>& v) {
m = v;
return (true);
}
diff --git a/src/lib/datasrc/tests/rbtree_unittest.cc b/src/lib/datasrc/tests/rbtree_unittest.cc
index 5da22ca..5c5bf21 100644
--- a/src/lib/datasrc/tests/rbtree_unittest.cc
+++ b/src/lib/datasrc/tests/rbtree_unittest.cc
@@ -34,8 +34,7 @@ using namespace isc::datasrc;
// XXX: some compilers cannot find class static constants used in
// EXPECT_xxx macros, for which we need an explicit empty definition.
-/// put the right #ifdef here
-#if !defined(_MSC_VER) && !defined(__GNUC__)
+#ifndef _MSC_VER
const size_t Name::MAX_LABELS;
#endif
diff --git a/src/lib/dns/tests/edns_unittest.cc b/src/lib/dns/tests/edns_unittest.cc
index 46a6ca8..0304b1f 100644
--- a/src/lib/dns/tests/edns_unittest.cc
+++ b/src/lib/dns/tests/edns_unittest.cc
@@ -38,8 +38,7 @@ using namespace isc::dns;
using namespace isc::util;
using namespace isc::dns::rdata;
-/// put the right #ifdef here
-#if !defined(_MSC_VER) && !defined(__GNUC__)
+#ifndef _MSC_VER
const uint8_t EDNS::SUPPORTED_VERSION;
#endif
diff --git a/src/lib/dns/tests/message_unittest.cc b/src/lib/dns/tests/message_unittest.cc
index d440962..8d19ac1 100644
--- a/src/lib/dns/tests/message_unittest.cc
+++ b/src/lib/dns/tests/message_unittest.cc
@@ -61,8 +61,7 @@ using namespace isc::dns::rdata;
// class, at which point we'll also revise the tests including more cases.
//
-/// put the right #ifdef here
-#if !defined(_MSC_VER) && !defined(__GNUC__)
+#ifndef _MSC_VER
const uint16_t Message::DEFAULT_MAX_UDPSIZE;
#endif
@@ -76,8 +75,7 @@ extern int64_t (*gettimeFunction)();
// XXX: this is defined as class static constants, but some compilers
// seemingly cannot find the symbol when used in the EXPECT_xxx macros.
-/// put the right #ifdef here
-#if !defined(_MSC_VER) && !defined(__GNUC__)
+#ifndef _MSC_VER
const uint16_t TSIGContext::DEFAULT_FUDGE;
#endif
diff --git a/src/lib/dns/tests/name_unittest.cc b/src/lib/dns/tests/name_unittest.cc
index 1b47332..075a111 100644
--- a/src/lib/dns/tests/name_unittest.cc
+++ b/src/lib/dns/tests/name_unittest.cc
@@ -37,8 +37,7 @@ using namespace isc::util;
// XXX: these are defined as class static constants, but some compilers
// seemingly cannot find the symbols when used in the EXPECT_xxx macros.
//
-/// put the right #ifdef here
-#if !defined(_MSC_VER) && !defined(__GNUC__)
+#ifndef _MSC_VER
const size_t Name::MAX_WIRE;
const size_t Name::MAX_LABELS;
#endif
diff --git a/src/lib/log/tests/logger_manager_unittest.cc b/src/lib/log/tests/logger_manager_unittest.cc
index 4bb92af..17bd4c2 100644
--- a/src/lib/log/tests/logger_manager_unittest.cc
+++ b/src/lib/log/tests/logger_manager_unittest.cc
@@ -121,7 +121,7 @@ public:
// Create file, close and delete it, and store the name for later.
// There is still a race condition here, albeit a small one.
#ifdef _WIN32
- _mktemp_s(tname.get(), filename.size());
+ _mktemp_s(tname.get(), filename.size() + 1);
#else
int filenum = mkstemp(tname.get());
if (filenum == -1) {
diff --git a/src/lib/log/tests/tempdir.h.win32 b/src/lib/log/tests/tempdir.h.win32
index 85e831d..5024b61 100644
--- a/src/lib/log/tests/tempdir.h.win32
+++ b/src/lib/log/tests/tempdir.h.win32
@@ -23,7 +23,7 @@
#include <string>
namespace {
-std::string TEMP_DIR(BIND10HOME "/bind10.trac826/src/lib/log/tests");
+std::string TEMP_DIR(BIND10HOME "/src/lib/log/tests");
}
#endif // __TEMPDIR_H
diff --git a/src/lib/nsas/nameserver_address_store.cc b/src/lib/nsas/nameserver_address_store.cc
index 2f08af7..71a29bc 100644
--- a/src/lib/nsas/nameserver_address_store.cc
+++ b/src/lib/nsas/nameserver_address_store.cc
@@ -27,6 +27,7 @@
#include <dns/rdataclass.h>
#include <util/locks.h>
#include <util/lru_list.h>
+#include <log/logger.h>
#include "hash_table.h"
#include "hash_deleter.h"
@@ -36,6 +37,7 @@
#include "zone_entry.h"
#include "glue_hints.h"
#include "address_request_callback.h"
+#include "nsas_log.h"
using namespace isc::dns;
using namespace std;
@@ -89,6 +91,8 @@ NameserverAddressStore::lookup(const string& zone, const RRClass& class_code,
boost::shared_ptr<AddressRequestCallback> callback, AddressFamily family,
const GlueHints& glue_hints)
{
+ LOG_DEBUG(nsas_logger, NSAS_DBG_TRACE, NSAS_SEARCH_ZONE_NS).arg(zone);
+
pair<bool, boost::shared_ptr<ZoneEntry> > zone_obj(
zone_hash_->getOrAdd(HashKey(zone, class_code),
boost::bind(newZone, resolver_, &zone, &class_code,
@@ -108,6 +112,8 @@ NameserverAddressStore::cancel(const string& zone,
const boost::shared_ptr<AddressRequestCallback>& callback,
AddressFamily family)
{
+ LOG_DEBUG(nsas_logger, NSAS_DBG_TRACE, NSAS_LOOKUP_CANCEL).arg(zone);
+
boost::shared_ptr<ZoneEntry> entry(zone_hash_->get(HashKey(zone,
class_code)));
if (entry) {
diff --git a/src/lib/nsas/nameserver_entry.cc b/src/lib/nsas/nameserver_entry.cc
index 5157f91..e7a5651 100644
--- a/src/lib/nsas/nameserver_entry.cc
+++ b/src/lib/nsas/nameserver_entry.cc
@@ -29,6 +29,8 @@
#include <strings.h>
#endif
+#include <config.h>
+
#include <exceptions/exceptions.h>
#include <dns/name.h>
#include <dns/rrclass.h>
@@ -43,6 +45,7 @@
#include "address_entry.h"
#include "nameserver_address.h"
#include "nameserver_entry.h"
+#include "nsas_log.h"
#ifdef _MSC_VER
#pragma warning(push)
@@ -186,6 +189,9 @@ NameserverEntry::updateAddressRTTAtIndex(uint32_t rtt, size_t index,
new_rtt = 1;
}
addresses_[family][index].setRTT(new_rtt);
+ LOG_DEBUG(nsas_logger, NSAS_DBG_RTT, NSAS_UPDATE_RTT)
+ .arg(addresses_[family][index].getAddress().toText())
+ .arg(old_rtt).arg(new_rtt);
}
void
@@ -211,7 +217,7 @@ NameserverEntry::setAddressUnreachable(const IOAddress& address) {
* \short A callback into the resolver.
*
* Whenever we ask the resolver something, this is created and the answer is
- * fed back trough this. It holds a shared pointer to the entry so it is not
+ * fed back through this. It holds a shared pointer to the entry so it is not
* destroyed too soon.
*/
class NameserverEntry::ResolverCallback :
@@ -238,6 +244,7 @@ class NameserverEntry::ResolverCallback :
if (!response_message ||
response_message->getRcode() != isc::dns::Rcode::NOERROR() ||
response_message->getRRCount(isc::dns::Message::SECTION_ANSWER) == 0) {
+ LOG_ERROR(nsas_logger, NSAS_INVALID_RESPONSE).arg(entry_->getName());
failureInternal(lock);
return;
}
@@ -251,7 +258,12 @@ class NameserverEntry::ResolverCallback :
if (response->getType() != type_ ||
response->getClass() != RRClass(entry_->getClass()))
{
- // TODO Log we got answer of different type
+ // Invalid response type or class
+ LOG_ERROR(nsas_logger, NSAS_WRONG_ANSWER)
+ .arg(entry_->getName()).arg(type_)
+ .arg(entry_->getClass()).arg(response->getType())
+ .arg(response->getClass());
+
failureInternal(lock);
return;
}
@@ -272,8 +284,10 @@ class NameserverEntry::ResolverCallback :
}
}
// If we found it, use it. If not, create a new one.
- entries.push_back(found ? *found : AddressEntry(IOAddress(
- i->getCurrent().toText()), 1));
+ entries.push_back(found ? *found : AddressEntry(
+ IOAddress(address), 1));
+ LOG_DEBUG(nsas_logger, NSAS_DBG_RESULTS, NSAS_FOUND_ADDRESS)
+ .arg(address).arg(entry_->getName());
}
// We no longer need the previous set of addresses, we have
@@ -318,6 +332,8 @@ class NameserverEntry::ResolverCallback :
* So mark the current address family as unreachable.
*/
virtual void failure() {
+ LOG_DEBUG(nsas_logger, NSAS_DBG_RESULTS, NSAS_NS_LOOKUP_FAIL)
+ .arg(type_).arg(entry_->getName());
Lock lock(entry_->mutex_);
failureInternal(lock);
}
@@ -430,6 +446,8 @@ NameserverEntry::askIP(isc::resolve::ResolverInterface* resolver,
// Ask for both types of addresses
// We are unlocked here, as the callback from that might want to lock
lock.unlock();
+
+ LOG_DEBUG(nsas_logger, NSAS_DBG_TRACE, NSAS_FIND_NS_ADDRESS).arg(getName());
askIP(resolver, RRType::A(), V4_ONLY);
askIP(resolver, RRType::AAAA(), V6_ONLY);
// Make sure we end the routine when we are not locked
diff --git a/src/lib/nsas/nsas_log.cc b/src/lib/nsas/nsas_log.cc
new file mode 100644
index 0000000..931b131
--- /dev/null
+++ b/src/lib/nsas/nsas_log.cc
@@ -0,0 +1,26 @@
+// Copyright (C) 2011 Internet Systems Consortium, Inc. ("ISC")
+//
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+// AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+// PERFORMANCE OF THIS SOFTWARE.
+
+/// Defines the logger used by the NSAS
+
+#include "nsas/nsas_log.h"
+
+namespace isc {
+namespace nsas {
+
+isc::log::Logger nsas_logger("nsas");
+
+} // namespace nsas
+} // namespace isc
+
diff --git a/src/lib/nsas/nsas_log.h b/src/lib/nsas/nsas_log.h
new file mode 100644
index 0000000..ec6844f
--- /dev/null
+++ b/src/lib/nsas/nsas_log.h
@@ -0,0 +1,53 @@
+// Copyright (C) 2011 Internet Systems Consortium, Inc. ("ISC")
+//
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+// AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+// PERFORMANCE OF THIS SOFTWARE.
+
+#ifndef __NSAS_LOG__H
+#define __NSAS_LOG__H
+
+#include <log/macros.h>
+#include "nsas_messages.h"
+
+namespace isc {
+namespace nsas {
+
+/// \brief NSAS Logging
+///
+/// Defines the levels used to output debug messages in the NSAS. Note that
+/// higher numbers equate to more verbose (and detailed) output.
+
+// The first level traces normal operations - asking the NSAS for an address,
+// and cancelling a lookup. It also records when the NSAS calls back to the
+// resolver to resolve something.
+const int NSAS_DBG_TRACE = 10;
+
+// The next level extends the normal operations and records the results of the
+// lookups.
+const int NSAS_DBG_RESULTS = 20;
+
+// Additional information on the usage of the names - the RTT values obtained
+// when queries were done.
+const int NSAS_DBG_RTT = 30;
+
+
+/// \brief NSAS Logger
+///
+/// Define the logger used to log messages. We could define it in multiple
+/// modules, but defining in a single module and linking to it saves time and
+/// space.
+extern isc::log::Logger nsas_logger; // isc::nsas::logger is the NSAS logger
+
+} // namespace nsas
+} // namespace isc
+
+#endif // __NSAS_LOG__H
diff --git a/src/lib/nsas/tests/Makefile.am b/src/lib/nsas/tests/Makefile.am
index 56f36d1..420e897 100644
--- a/src/lib/nsas/tests/Makefile.am
+++ b/src/lib/nsas/tests/Makefile.am
@@ -43,8 +43,8 @@ run_unittests_SOURCES += zone_entry_unittest.cc
run_unittests_SOURCES += fetchable_unittest.cc
run_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES)
-run_unittests_LDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS)
-run_unittests_LDADD = $(GTEST_LDADD)
+run_unittests_LDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS)
+run_unittests_LDADD = $(GTEST_LDADD)
# NOTE: we may have to clean up this hack later (see the note in configure.ac)
if NEED_LIBBOOST_THREAD
@@ -53,8 +53,10 @@ endif
run_unittests_LDADD += $(top_builddir)/src/lib/nsas/libnsas.la
run_unittests_LDADD += $(top_builddir)/src/lib/util/libutil.la
+run_unittests_LDADD += $(top_builddir)/src/lib/log/liblog.la
run_unittests_LDADD += $(top_builddir)/src/lib/dns/libdns++.la
run_unittests_LDADD += $(top_builddir)/src/lib/asiolink/libasiolink.la
+run_unittests_LDADD += $(top_builddir)/src/lib/util/unittests/libutil_unittests.la
run_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libexceptions.la
endif
diff --git a/src/lib/nsas/tests/run_unittests.cc b/src/lib/nsas/tests/run_unittests.cc
index d1277ad..e469e03 100644
--- a/src/lib/nsas/tests/run_unittests.cc
+++ b/src/lib/nsas/tests/run_unittests.cc
@@ -12,15 +12,13 @@
// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE.
-#include <config.h>
-
#include <gtest/gtest.h>
-
-#include <dns/tests/unittest_util.h>
+#include <log/logger_support.h>
+#include <util/unittests/run_all.h>
int
main(int argc, char* argv[]) {
::testing::InitGoogleTest(&argc, argv);
-
- return (RUN_ALL_TESTS());
+ isc::log::initLogger();
+ return (isc::util::unittests::run_all());
}
diff --git a/src/lib/resolve/recursive_query.cc b/src/lib/resolve/recursive_query.cc
index 0ddc9e1..eac12d2 100644
--- a/src/lib/resolve/recursive_query.cc
+++ b/src/lib/resolve/recursive_query.cc
@@ -983,8 +983,10 @@ public:
client_timer.cancel();
if (outstanding_events_ > 0) {
return;
+#ifndef _MSC_VER
} else {
delete this;
+#endif
}
}
diff --git a/win32build/VS2010/libnsas/libnsas.vcxproj b/win32build/VS2010/libnsas/libnsas.vcxproj
index 3d30751..f0f08e4 100755
--- a/win32build/VS2010/libnsas/libnsas.vcxproj
+++ b/win32build/VS2010/libnsas/libnsas.vcxproj
@@ -25,6 +25,7 @@
<ClInclude Include="..\..\..\src\lib\nsas\nameserver_entry.h" />
<ClInclude Include="..\..\..\src\lib\nsas\nsas_entry.h" />
<ClInclude Include="..\..\..\src\lib\nsas\nsas_entry_compare.h" />
+ <ClInclude Include="..\..\..\src\lib\nsas\nsas_log.h" />
<ClInclude Include="..\..\..\src\lib\nsas\nsas_messages.h" />
<ClInclude Include="..\..\..\src\lib\nsas\nsas_types.h" />
<ClInclude Include="..\..\..\src\lib\nsas\zone_entry.h" />
@@ -37,6 +38,7 @@
<ClCompile Include="..\..\..\src\lib\nsas\nameserver_address.cc" />
<ClCompile Include="..\..\..\src\lib\nsas\nameserver_address_store.cc" />
<ClCompile Include="..\..\..\src\lib\nsas\nameserver_entry.cc" />
+ <ClCompile Include="..\..\..\src\lib\nsas\nsas_log.cc" />
<ClCompile Include="..\..\..\src\lib\nsas\nsas_messages.cc" />
<ClCompile Include="..\..\..\src\lib\nsas\zone_entry.cc" />
</ItemGroup>
diff --git a/win32build/VS2010/libnsas/libnsas.vcxproj.filters b/win32build/VS2010/libnsas/libnsas.vcxproj.filters
index df69ac0..e6026be 100755
--- a/win32build/VS2010/libnsas/libnsas.vcxproj.filters
+++ b/win32build/VS2010/libnsas/libnsas.vcxproj.filters
@@ -66,6 +66,9 @@
<ClInclude Include="..\..\..\src\lib\nsas\nsas_messages.h">
<Filter>Header Files</Filter>
</ClInclude>
+ <ClInclude Include="..\..\..\src\lib\nsas\nsas_log.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\src\lib\nsas\address_entry.cc">
@@ -95,5 +98,8 @@
<ClCompile Include="..\..\..\src\lib\nsas\nsas_messages.cc">
<Filter>Source Files</Filter>
</ClCompile>
+ <ClCompile Include="..\..\..\src\lib\nsas\nsas_log.cc">
+ <Filter>Source Files</Filter>
+ </ClCompile>
</ItemGroup>
</Project>
\ No newline at end of file
diff --git a/win32build/VS2010/libnsas_tests/libnsas_tests.vcxproj b/win32build/VS2010/libnsas_tests/libnsas_tests.vcxproj
index 1c26ebe..47f64b7 100755
--- a/win32build/VS2010/libnsas_tests/libnsas_tests.vcxproj
+++ b/win32build/VS2010/libnsas_tests/libnsas_tests.vcxproj
@@ -60,8 +60,8 @@
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OutputFile>$(OutDir)run_unittests$(TargetExt)</OutputFile>
- <AdditionalDependencies>libexceptions.lib;libutil.lib;libcryptolink.lib;libdns++.lib;libasiolink.lib;libnsas.lib;botan.lib;gtestd.lib;%(AdditionalDependencies)</AdditionalDependencies>
- <AdditionalLibraryDirectories>..\libexceptions\Debug;..\libutil\Debug;..\libcryptolink\Debug;..\libdns++\Debug;..\libasiolink\Debug;..\libnsas\Debug;..\..\..\..\botan\md10\Debug;..\..\..\..\gtest\md10\Debug;%BOOST%\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <AdditionalDependencies>libexceptions.lib;libutil.lib;libutil_unittests.lib;liblog.lib;libcryptolink.lib;libdns++.lib;libasiolink.lib;libnsas.lib;botan.lib;log4cplusSD.lib;gtestd.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalLibraryDirectories>..\libexceptions\Debug;..\libutil\Debug;..\libutil_unittests\Debug;..\liblog\Debug;..\libcryptolink\Debug;..\libdns++\Debug;..\libasiolink\Debug;..\libnsas\Debug;..\..\..\..\botan\md10\Debug;..\..\..\..\log4cplus\md10\Debug;..\..\..\..\gtest\md10\Debug;%BOOST%\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@@ -81,8 +81,8 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<OutputFile>$(OutDir)run_unittests$(TargetExt)</OutputFile>
- <AdditionalDependencies>libexceptions.lib;libutil.lib;libcryptolink.lib;libdns++.lib;libasiolink.lib;libnsas.lib;botan.lib;gtest.lib;%(AdditionalDependencies)</AdditionalDependencies>
- <AdditionalLibraryDirectories>..\libexceptions\Release;..\libutil\Release;..\libcryptolink\Release;..\libdns++\Release;..\libasiolink\Release;..\libnsas\Release;..\..\..\..\botan\md10\Release;..\..\..\..\gtest\md10\Release;%BOOST%\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <AdditionalDependencies>libexceptions.lib;libutil.lib;libutil_unittests.lib;liblog.lib;libcryptolink.lib;libdns++.lib;libasiolink.lib;libnsas.lib;botan.lib;log4cplusS.lib;gtest.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalLibraryDirectories>..\libexceptions\Release;..\libutil\Release;..\libutil_unittests\Release;..\liblog\Release;..\libcryptolink\Release;..\libdns++\Release;..\libasiolink\Release;..\libnsas\Release;..\..\..\..\botan\md10\Release;..\..\..\..\log4cplus\md10\Release;..\..\..\..\gtest\md10\Release;%BOOST%\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
More information about the bind10-changes
mailing list