]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3316] fixed doxygen
authorRazvan Becheriu <razvan@isc.org>
Tue, 2 Apr 2024 12:38:43 +0000 (15:38 +0300)
committerRazvan Becheriu <razvan@isc.org>
Wed, 3 Apr 2024 20:11:45 +0000 (23:11 +0300)
170 files changed:
configure.ac
src/bin/dhcp4/tests/dhcp4_unittests.cc
src/bin/dhcp6/tests/dhcp6_unittests.cc
src/hooks/dhcp/bootp/libloadtests/run_unittests.cc
src/hooks/dhcp/lease_cmds/libloadtests/run_unittests.cc
src/hooks/dhcp/mysql_cb/libloadtests/run_unittests.cc
src/hooks/dhcp/mysql_cb/tests/run_unittests.cc
src/hooks/dhcp/perfmon/libloadtests/run_unittests.cc
src/hooks/dhcp/pgsql_cb/libloadtests/run_unittests.cc
src/hooks/dhcp/pgsql_cb/tests/run_unittests.cc
src/hooks/dhcp/stat_cmds/libloadtests/run_unittests.cc
src/hooks/dhcp/user_chk/tests/run_unittests.cc
src/lib/asiodns/Makefile.am
src/lib/asiodns/README [deleted file]
src/lib/asiodns/asiodns.dox [new file with mode: 0644]
src/lib/asiodns/io_fetch.cc
src/lib/asiodns/io_fetch.h
src/lib/asiodns/tests/Makefile.am
src/lib/asiodns/tests/io_fetch_unittest.cc
src/lib/asiodns/tests/run_unittests.cc
src/lib/asiolink/Makefile.am
src/lib/asiolink/dummy_io_cb.h
src/lib/asiolink/interval_timer.cc
src/lib/asiolink/interval_timer.h
src/lib/asiolink/io_address.cc
src/lib/asiolink/io_address.h
src/lib/asiolink/io_asio_socket.h
src/lib/asiolink/io_endpoint.cc
src/lib/asiolink/io_endpoint.h
src/lib/asiolink/io_error.h
src/lib/asiolink/io_service.cc
src/lib/asiolink/io_service.h
src/lib/asiolink/io_socket.cc
src/lib/asiolink/io_socket.h
src/lib/asiolink/tcp_endpoint.h
src/lib/asiolink/tcp_socket.h
src/lib/asiolink/tests/Makefile.am
src/lib/asiolink/tests/interval_timer_unittest.cc
src/lib/asiolink/tests/run_unittests.cc
src/lib/asiolink/tests/tcp_socket_unittest.cc
src/lib/asiolink/tests/udp_socket_unittest.cc
src/lib/asiolink/udp_endpoint.h
src/lib/asiolink/udp_socket.h
src/lib/cc/data.h
src/lib/cc/tests/command_interpreter_unittests.cc
src/lib/cc/tests/run_unittests.cc
src/lib/config/tests/.gitignore
src/lib/config/tests/Makefile.am
src/lib/config/tests/data_def_unittests_config.h.in [deleted file]
src/lib/config/tests/run_unittests.cc
src/lib/config/tests/testdata/Makefile.am [deleted file]
src/lib/config/tests/testdata/data22_1.data [deleted file]
src/lib/config/tests/testdata/data22_10.data [deleted file]
src/lib/config/tests/testdata/data22_2.data [deleted file]
src/lib/config/tests/testdata/data22_3.data [deleted file]
src/lib/config/tests/testdata/data22_4.data [deleted file]
src/lib/config/tests/testdata/data22_5.data [deleted file]
src/lib/config/tests/testdata/data22_6.data [deleted file]
src/lib/config/tests/testdata/data22_7.data [deleted file]
src/lib/config/tests/testdata/data22_8.data [deleted file]
src/lib/config/tests/testdata/data22_9.data [deleted file]
src/lib/config/tests/testdata/data32_1.data [deleted file]
src/lib/config/tests/testdata/data32_2.data [deleted file]
src/lib/config/tests/testdata/data32_3.data [deleted file]
src/lib/config/tests/testdata/data33_1.data [deleted file]
src/lib/config/tests/testdata/data33_2.data [deleted file]
src/lib/config/tests/testdata/data41_1.data [deleted file]
src/lib/config/tests/testdata/data41_2.data [deleted file]
src/lib/config/tests/testdata/spec1.spec [deleted file]
src/lib/config/tests/testdata/spec10.spec [deleted file]
src/lib/config/tests/testdata/spec11.spec [deleted file]
src/lib/config/tests/testdata/spec12.spec [deleted file]
src/lib/config/tests/testdata/spec13.spec [deleted file]
src/lib/config/tests/testdata/spec14.spec [deleted file]
src/lib/config/tests/testdata/spec15.spec [deleted file]
src/lib/config/tests/testdata/spec16.spec [deleted file]
src/lib/config/tests/testdata/spec17.spec [deleted file]
src/lib/config/tests/testdata/spec18.spec [deleted file]
src/lib/config/tests/testdata/spec19.spec [deleted file]
src/lib/config/tests/testdata/spec2.spec [deleted file]
src/lib/config/tests/testdata/spec20.spec [deleted file]
src/lib/config/tests/testdata/spec21.spec [deleted file]
src/lib/config/tests/testdata/spec22.spec [deleted file]
src/lib/config/tests/testdata/spec23.spec [deleted file]
src/lib/config/tests/testdata/spec24.spec [deleted file]
src/lib/config/tests/testdata/spec25.spec [deleted file]
src/lib/config/tests/testdata/spec26.spec [deleted file]
src/lib/config/tests/testdata/spec27.spec [deleted file]
src/lib/config/tests/testdata/spec28.spec [deleted file]
src/lib/config/tests/testdata/spec29.spec [deleted file]
src/lib/config/tests/testdata/spec3.spec [deleted file]
src/lib/config/tests/testdata/spec30.spec [deleted file]
src/lib/config/tests/testdata/spec31.spec [deleted file]
src/lib/config/tests/testdata/spec32.spec [deleted file]
src/lib/config/tests/testdata/spec33.spec [deleted file]
src/lib/config/tests/testdata/spec34.spec [deleted file]
src/lib/config/tests/testdata/spec35.spec [deleted file]
src/lib/config/tests/testdata/spec36.spec [deleted file]
src/lib/config/tests/testdata/spec37.spec [deleted file]
src/lib/config/tests/testdata/spec38.spec [deleted file]
src/lib/config/tests/testdata/spec39.spec [deleted file]
src/lib/config/tests/testdata/spec4.spec [deleted file]
src/lib/config/tests/testdata/spec40.spec [deleted file]
src/lib/config/tests/testdata/spec41.spec [deleted file]
src/lib/config/tests/testdata/spec42.spec [deleted file]
src/lib/config/tests/testdata/spec5.spec [deleted file]
src/lib/config/tests/testdata/spec6.spec [deleted file]
src/lib/config/tests/testdata/spec7.spec [deleted file]
src/lib/config/tests/testdata/spec8.spec [deleted file]
src/lib/config/tests/testdata/spec9.spec [deleted file]
src/lib/config_backend/tests/Makefile.am
src/lib/config_backend/tests/run_unittests.cc
src/lib/cryptolink/cryptolink.h
src/lib/cryptolink/tests/run_unittests.cc
src/lib/d2srv/tests/Makefile.am
src/lib/d2srv/tests/run_unittests.cc
src/lib/database/tests/Makefile.am
src/lib/database/tests/run_unittests.cc
src/lib/dhcp/tests/Makefile.am
src/lib/dhcp/tests/option6_pdexclude_unittest.cc
src/lib/dhcp/tests/run_unittests.cc
src/lib/dhcp_ddns/tests/Makefile.am
src/lib/dhcp_ddns/tests/run_unittests.cc
src/lib/dhcpsrv/tests/Makefile.am
src/lib/dhcpsrv/tests/run_unittests.cc
src/lib/dns/message.h
src/lib/dns/name.h
src/lib/dns/question.h
src/lib/dns/rdata.h
src/lib/dns/rrparamregistry.h
src/lib/dns/rrttl.h
src/lib/dns/tsigkey.cc
src/lib/dns/tsigkey.h
src/lib/eval/tests/Makefile.am
src/lib/eval/tests/run_unittests.cc
src/lib/exceptions/exceptions.h
src/lib/hooks/tests/run_unittests.cc
src/lib/http/tests/Makefile.am
src/lib/http/tests/run_unittests.cc
src/lib/log/Makefile.am
src/lib/log/compiler/message.cc
src/lib/log/message_reader.cc
src/lib/mysql/tests/Makefile.am
src/lib/mysql/tests/run_unittests.cc
src/lib/pgsql/tests/Makefile.am
src/lib/pgsql/tests/run_unittests.cc
src/lib/process/cfgrpt/tests/Makefile.am
src/lib/process/cfgrpt/tests/run_unittests.cc
src/lib/process/tests/run_unittests.cc
src/lib/stats/tests/Makefile.am
src/lib/stats/tests/run_unittests.cc
src/lib/tcp/tests/Makefile.am
src/lib/tcp/tests/run_unittests.cc
src/lib/util/io/fd_share.cc
src/lib/util/io/fd_share.h
src/lib/util/io/sockaddr_util.h
src/lib/util/io/socketsession.h
src/lib/util/memory_segment.h
src/lib/util/memory_segment_local.h
src/lib/util/python/gen_wiredata.py.in
src/lib/util/tests/buffer_unittest.cc
src/lib/util/tests/memory_segment_common_unittest.h
src/lib/util/unittests/interprocess_util.h
src/lib/util/unittests/mock_socketsession.h
src/lib/util/unittests/newhook.h
src/lib/util/unittests/resource.h
src/lib/util/unittests/testdata.h
src/lib/util/unittests/textdata.h
src/lib/util/unittests/wiredata.h
src/lib/yang/tests/run_unittests.cc

index eeb158314503857c4cf87479901ebdfed5f91f70..4e6bfd4bd2165f099e08a5acb264d8e5ad7eecad 100644 (file)
@@ -1596,8 +1596,6 @@ AC_CONFIG_FILES([src/lib/cc/Makefile])
 AC_CONFIG_FILES([src/lib/cc/tests/Makefile])
 AC_CONFIG_FILES([src/lib/config/Makefile])
 AC_CONFIG_FILES([src/lib/config/tests/Makefile])
-AC_CONFIG_FILES([src/lib/config/tests/data_def_unittests_config.h])
-AC_CONFIG_FILES([src/lib/config/tests/testdata/Makefile])
 AC_CONFIG_FILES([src/lib/config_backend/Makefile])
 AC_CONFIG_FILES([src/lib/config_backend/tests/Makefile])
 AC_CONFIG_FILES([src/lib/cryptolink/Makefile])
index 3a7d4ec2a3972ad3f4444e925ea12d1584ade546..5e94bb40cec80373ca0eb01f1a0aff7670dd652e 100644 (file)
@@ -7,7 +7,7 @@
 #include <config.h>
 
 #include <log/logger_support.h>
-#include <dhcp4/dhcp4_log.h>
+
 #include <gtest/gtest.h>
 
 int
index a98f513ba182cdc6d28764876f2495f49a63d639..e5516027894eb1c699a23f663b9077d836ec4894 100644 (file)
@@ -14,10 +14,13 @@ int
 main(int argc, char* argv[]) {
 
     ::testing::InitGoogleTest(&argc, argv);
+
+    // See the documentation of the KEA_* environment variables in
+    // src/lib/log/README for info on how to tweak logging
     isc::log::initLogger();
 
     setenv("KEA_PIDFILE_DIR", TEST_DATA_BUILDDIR, 1);
     int result = RUN_ALL_TESTS();
 
-    return result;
+    return (result);
 }
index d9e195d96f6d89025c377b382f18401d0adfeaba..96a0ba7bb7c22af3d960cbfb3246f56cfcc53247 100644 (file)
@@ -1,19 +1,18 @@
 // Copyright (C) 2022 Internet Systems Consortium, Inc. ("ISC")
 //
-// This Source Code Form is subject to the terms of the End User License
-// Agreement. See COPYING file in the premium/ directory.
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License, v. 2.0. If a copy of the MPL was not distributed with this
+// file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 #include <config.h>
 
 #include <log/logger_support.h>
-
 #include <gtest/gtest.h>
 
 int
 main(int argc, char* argv[]) {
     ::testing::InitGoogleTest(&argc, argv);
     isc::log::initLogger();
-
     int result = RUN_ALL_TESTS();
 
     return (result);
index d9e195d96f6d89025c377b382f18401d0adfeaba..96a0ba7bb7c22af3d960cbfb3246f56cfcc53247 100644 (file)
@@ -1,19 +1,18 @@
 // Copyright (C) 2022 Internet Systems Consortium, Inc. ("ISC")
 //
-// This Source Code Form is subject to the terms of the End User License
-// Agreement. See COPYING file in the premium/ directory.
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License, v. 2.0. If a copy of the MPL was not distributed with this
+// file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 #include <config.h>
 
 #include <log/logger_support.h>
-
 #include <gtest/gtest.h>
 
 int
 main(int argc, char* argv[]) {
     ::testing::InitGoogleTest(&argc, argv);
     isc::log::initLogger();
-
     int result = RUN_ALL_TESTS();
 
     return (result);
index d9e195d96f6d89025c377b382f18401d0adfeaba..96a0ba7bb7c22af3d960cbfb3246f56cfcc53247 100644 (file)
@@ -1,19 +1,18 @@
 // Copyright (C) 2022 Internet Systems Consortium, Inc. ("ISC")
 //
-// This Source Code Form is subject to the terms of the End User License
-// Agreement. See COPYING file in the premium/ directory.
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License, v. 2.0. If a copy of the MPL was not distributed with this
+// file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 #include <config.h>
 
 #include <log/logger_support.h>
-
 #include <gtest/gtest.h>
 
 int
 main(int argc, char* argv[]) {
     ::testing::InitGoogleTest(&argc, argv);
     isc::log::initLogger();
-
     int result = RUN_ALL_TESTS();
 
     return (result);
index 6ec23da40420267aaf0db61d606dd21349efc9b6..906418008ae72b12742b3812c98d7de59cb36de6 100644 (file)
@@ -7,7 +7,6 @@
 #include <config.h>
 
 #include <log/logger_support.h>
-
 #include <gtest/gtest.h>
 
 int
index 0500503ac21ad16fc40f37c8eeebd3b10d801409..755b9e4e88ed04b179f2874b4ae22d49ca26c4bd 100644 (file)
@@ -1,19 +1,18 @@
 // Copyright (C) 2024 Internet Systems Consortium, Inc. ("ISC")
 //
-// This Source Code Form is subject to the terms of the End User License
-// Agreement. See COPYING file in the premium/ directory.
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License, v. 2.0. If a copy of the MPL was not distributed with this
+// file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 #include <config.h>
 
 #include <log/logger_support.h>
-
 #include <gtest/gtest.h>
 
 int
 main(int argc, char* argv[]) {
     ::testing::InitGoogleTest(&argc, argv);
     isc::log::initLogger();
-
     int result = RUN_ALL_TESTS();
 
     return (result);
index d9e195d96f6d89025c377b382f18401d0adfeaba..96a0ba7bb7c22af3d960cbfb3246f56cfcc53247 100644 (file)
@@ -1,19 +1,18 @@
 // Copyright (C) 2022 Internet Systems Consortium, Inc. ("ISC")
 //
-// This Source Code Form is subject to the terms of the End User License
-// Agreement. See COPYING file in the premium/ directory.
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License, v. 2.0. If a copy of the MPL was not distributed with this
+// file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 #include <config.h>
 
 #include <log/logger_support.h>
-
 #include <gtest/gtest.h>
 
 int
 main(int argc, char* argv[]) {
     ::testing::InitGoogleTest(&argc, argv);
     isc::log::initLogger();
-
     int result = RUN_ALL_TESTS();
 
     return (result);
index 74904a3d921434a74830a002335b6d6357bbc619..1b4d40ccbbfe21d3af20dc43ec2be3fac67c3626 100644 (file)
@@ -7,7 +7,6 @@
 #include <config.h>
 
 #include <log/logger_support.h>
-
 #include <gtest/gtest.h>
 
 int
index d9e195d96f6d89025c377b382f18401d0adfeaba..96a0ba7bb7c22af3d960cbfb3246f56cfcc53247 100644 (file)
@@ -1,19 +1,18 @@
 // Copyright (C) 2022 Internet Systems Consortium, Inc. ("ISC")
 //
-// This Source Code Form is subject to the terms of the End User License
-// Agreement. See COPYING file in the premium/ directory.
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License, v. 2.0. If a copy of the MPL was not distributed with this
+// file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 #include <config.h>
 
 #include <log/logger_support.h>
-
 #include <gtest/gtest.h>
 
 int
 main(int argc, char* argv[]) {
     ::testing::InitGoogleTest(&argc, argv);
     isc::log::initLogger();
-
     int result = RUN_ALL_TESTS();
 
     return (result);
index 83d8a9fa8e685da86d8fc2cca9a3eb485c3ee787..1dc48fd090c1d9f31f100104b0192e357f5b9e90 100644 (file)
@@ -7,14 +7,12 @@
 #include <config.h>
 
 #include <log/logger_support.h>
-
 #include <gtest/gtest.h>
 
 int
 main(int argc, char* argv[]) {
     ::testing::InitGoogleTest(&argc, argv);
     isc::log::initLogger();
-
     int result = RUN_ALL_TESTS();
 
     return (result);
index b7802cd63c40ec88e7692f90b32073a17d479de4..5ac221b393a4a1ab760dba0168f5c3d067b2bfae 100644 (file)
@@ -1,12 +1,14 @@
 SUBDIRS = . tests
 
-AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
+AM_CPPFLAGS  = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
 AM_CPPFLAGS += $(BOOST_INCLUDES)
 
 AM_CXXFLAGS = $(KEA_CXXFLAGS)
 
 CLEANFILES = *.gcno *.gcda
 
+EXTRA_DIST = asiodns_messages.mes
+
 lib_LTLIBRARIES = libkea-asiodns.la
 
 libkea_asiodns_la_LDFLAGS = -no-undefined -version-info 47:0:0
@@ -15,10 +17,7 @@ libkea_asiodns_la_SOURCES = io_fetch.cc io_fetch.h
 libkea_asiodns_la_SOURCES += logger.h logger.cc
 libkea_asiodns_la_SOURCES += asiodns_messages.cc asiodns_messages.h
 
-EXTRA_DIST = asiodns_messages.mes
-
-# Note: the ordering matters: -Wno-... must follow -Wextra (defined in
-# KEA_CXXFLAGS)
+# Note: the ordering matters: -Wno-... must follow -Wextra (defined in KEA_CXXFLAGS)
 libkea_asiodns_la_CXXFLAGS = $(AM_CXXFLAGS)
 libkea_asiodns_la_CPPFLAGS = $(AM_CPPFLAGS)
 libkea_asiodns_la_LIBADD  = $(top_builddir)/src/lib/asiolink/libkea-asiolink.la
diff --git a/src/lib/asiodns/README b/src/lib/asiodns/README
deleted file mode 100644 (file)
index e785845..0000000
+++ /dev/null
@@ -1,154 +0,0 @@
-The asiodns library is intended to provide an abstraction layer between
-BIND10 modules and asiolink library.
-
-These DNS server and client routines are written using the "stackless
-coroutine" pattern invented by Chris Kohlhoff and described at
-http://blog.think-async.com/2010/03/potted-guide-to-stackless-coroutines.html.
-This is intended to simplify development a bit, since it allows the
-routines to be written in a straightforward step-step-step fashion rather
-than as a complex chain of separate handler functions.
-
-Coroutine objects (i.e., UDPServer, TCPServer and IOFetch) are objects
-with reentrant operator() members.  When an instance of one of these
-classes is called as a function, it resumes at the position where it left
-off.  Thus, a UDPServer can issue an asynchronous I/O call and specify
-itself as the handler object; when the call completes, the UDPServer
-carries on at the same position.  As a result, the code can look as
-if it were using synchronous, not asynchronous, I/O, providing some of
-the benefit of threading but with minimal switching overhead.
-
-So, in simplified form, the behavior of a DNS Server is:
-
-  REENTER:
-    while true:
-      YIELD packet = read_packet
-      FORK
-      if not parent:
-        break
-
-    YIELD answer = DNSLookup(packet, this)
-    response = DNSAnswer(answer)
-    YIELD send(response)
-
-At each "YIELD" point, the coroutine initiates an asynchronous operation,
-then pauses and turns over control to some other task on the ASIO service
-queue.  When the operation completes, the coroutine resumes.
-
-DNSLookup and DNSAnswer define callback methods
-used by a DNS Server to communicate with the module that called it.
-They are abstract-only classes whose concrete implementations
-are supplied by the calling module.
-
-The DNSLookup callback always runs asynchronously.  Concrete
-implementations must be sure to call the server's "resume" method when
-it is finished.
-
-In an authoritative server, the DNSLookup implementation would examine
-the query, look up the answer, then call "resume".  (See the diagram
-in doc/auth_process.jpg.)
-
-In a recursive server, the DNSLookup implementation would initiate a
-DNSQuery, which in turn would be responsible for calling the server's
-"resume" method.  (See the diagram in doc/recursive_process.jpg.)
-
-A DNSQuery object is intended to handle resolution of a query over
-the network when the local authoritative data sources or cache are not
-sufficient.  The plan is that it will make use of subsidiary DNSFetch
-calls to get data from particular authoritative servers, and when it has
-gotten a complete answer, it calls "resume".
-
-In current form, however, DNSQuery is much simpler; it forwards queries
-to a single upstream resolver and passes the answers back to the client.
-It is constructed with the address of the forward server.  Queries are
-initiated with the question to ask the forward server, a buffer into
-which to write the answer, and a pointer to the coroutine to be resumed
-when the answer has arrived.  In simplified form, the DNSQuery routine is:
-
-  REENTER:
-    render the question into a wire-format query packet
-    YIELD send(query)
-    YIELD response = read_packet
-    server->resume
-
-Currently, DNSQuery is only implemented for UDP queries.  In future work
-it will be necessary to write code to fall back to TCP when circumstances
-require it.
-
-
-Upstream Fetches
-================
-Upstream fetches (queries by the resolver on behalf of a client) are made
-using a slightly-modified version of the pattern described above.
-
-Sockets
--------
-First, it will be useful to understand the class hierarchy used in the
-fetch logic:
-
-        IOSocket
-           |
-      IOAsioSocket
-           |
-     +-----+-----+
-     |           |
-UDPSocket    TCPSocket
-
-IOSocket is a wrapper class for a socket and is used by the authoritative
-server code.  It is an abstract base class, providing little more that the ability to hold the socket and to return the protocol in use.
-
-Built on this is IOAsioSocket, which adds the open, close, asyncSend and
-asyncReceive methods.  This is a template class, which takes as template
-argument the class of the object that will be used as the callback when the
-asynchronous operation completes. This object can be of any type, but must
-include an operator() method with the signature:
-
-   operator()(boost::system::error_code ec, size_t length)
-
-... the two arguments being the status of the completed I/O operation and
-the number of bytes transferred. (In the case of the open method, the second
-argument will be zero.)
-
-Finally, the TCPSocket and UDPSocket classes provide the body of the
-asynchronous operations.
-
-Fetch Sequence
---------------
-The fetch is implemented by the IOFetch class, which takes as argument the
-protocol to use.  The sequence is:
-
-  REENTER:
-    render the question into a wire-format query packet
-    open()                           // Open socket and optionally connect
-    if (! synchronous) {
-        YIELD;
-    }
-    YIELD asyncSend(query)           // Send query
-    do {
-        YIELD asyncReceive(response) // Read response
-    } while (! complete(response))
-    close()                          // Drop connection and close socket
-    server->resume
-
-The open() method opens a socket for use.  On TCP, it also makes a
-connection to the remote end.  So under UDP the operation will complete
-immediately, but under TCP it could take a long time.  One solution would be
-for the open operation to post an event to the I/O queue; then both cases
-could be regarded as being equivalent, with the completion being signalled
-by the posting of the completion event.  However UDP is the most common case
-and that would involve extra overhead.  So the open() returns a status
-indicating whether the operation completed asynchronously.  If it did, the
-code yields back to the coroutine; if not the yield is bypassed.
-
-The asynchronous send is straightforward, invoking the underlying ASIO
-function.  (Note that the address/port is supplied to both the open() and
-asyncSend() methods - it is used by the TCPSocket in open() and by the
-UDPSocket in asyncSend().)
-
-The asyncReceive() method issues an asynchronous read and waits for completion.
-The fetch object keeps track of the amount of data received so far and when
-the receive completes it calls a method on the socket to determine if the
-entire message has been received.  (This will always be the case for UDP.  On
-TCP though, the message is preceded by a count field as several reads may be
-required to read all the data.)  The fetch loops until all the data is read.
-
-Finally, the socket is closed and the server called to resume operation.
diff --git a/src/lib/asiodns/asiodns.dox b/src/lib/asiodns/asiodns.dox
new file mode 100644 (file)
index 0000000..e27c05d
--- /dev/null
@@ -0,0 +1,150 @@
+The asiodns library is intended to provide an abstraction layer between Kea
+modules and asiolink library.
+
+These DNS server and client routines are written using the "stackless coroutine"
+pattern invented by Chris Kohlhoff and described at:
+http://blog.think-async.com/2010/03/potted-guide-to-stackless-coroutines.html.
+This is intended to simplify development a bit, since it allows the routines to
+be written in a straightforward step-step-step fashion rather than as a complex
+chain of separate handler functions.
+
+Coroutine objects (i.e., UDPServer, TCPServer and IOFetch) are objects with
+reentrant operator() members.  When an instance of one of these classes is
+called as a function, it resumes at the position where it left off.  Thus, an
+UDPServer can issue an asynchronous I/O call and specify itself as the handler
+object; when the call completes, the UDPServer carries on at the same position.
+As a result, the code can look as if it were using synchronous, not asynchronous
+I/O, providing some of the benefit of threading but with minimal switching
+overhead.
+
+So, in simplified form, the behavior of a DNS Server is:
+
+    REENTER:
+        while true:
+            YIELD packet = read_packet
+            FORK
+            if not parent:
+                break
+
+        YIELD answer = DNSLookup(packet, this)
+        response = DNSAnswer(answer)
+        YIELD send(response)
+
+At each "YIELD" point, the coroutine initiates an asynchronous operation, then
+pauses and turns over control to some other task on the ASIO service queue. When
+the operation completes, the coroutine resumes.
+
+The DNSLookup and DNSAnswer define callback methods used by a DNS Server to
+communicate with the module that called it. They are abstract-only classes whose
+concrete implementations are supplied by the calling module.
+
+The DNSLookup callback always runs asynchronously. Concrete implementations must
+be sure to call the server's "resume" method when it is finished.
+
+In an authoritative server, the DNSLookup implementation would examine the query,
+look up the answer, then call "resume" (See the diagram in doc/auth_process.jpg).
+
+In a recursive server, the DNSLookup implementation would initiate a DNSQuery,
+which in turn would be responsible for calling the server's "resume" method
+(See the diagram in doc/recursive_process.jpg).
+
+A DNSQuery object is intended to handle resolution of a query over the network
+when the local authoritative data sources or cache are not sufficient. The plan
+is that it will make use of subsidiary DNSFetch calls to get data from\
+particular authoritative servers, and when it has gotten a complete answer, it
+calls "resume".
+
+In current form, however, DNSQuery is much simpler; it forwards queries to a
+single upstream resolver and passes the answers back to the client. It is
+constructed with the address of the forward server. Queries are initiated with
+the question to ask the forward server, a buffer into which to write the answer,
+and a pointer to the coroutine to be resumed when the answer has arrived. In
+simplified form, the DNSQuery routine is:
+
+    REENTER:
+        render the question into a wire-format query packet
+        YIELD send(query)
+        YIELD response = read_packet
+        server->resume
+
+Currently, DNSQuery is only implemented for UDP queries. In future work it will
+be necessary to write code to fall back to TCP when circumstances require it.
+
+Upstream Fetches
+================
+Upstream fetches (queries by the resolver on behalf of a client) are made using
+a slightly-modified version of the pattern described above.
+
+Sockets
+-------
+First, it will be useful to understand the class hierarchy used in the fetch
+logic:
+
+         IOSocket
+             |
+        IOAsioSocket
+             |
+       +-----+-----+
+       |           |
+  UDPSocket    TCPSocket
+
+IOSocket is a wrapper class for a socket and is used by the authoritative server
+code. It is an abstract base class, providing little more that the ability to
+hold the socket and to return the protocol in use.
+
+Built on this is the IOAsioSocket, which adds the open, close, asyncSend and
+asyncReceive methods. This is a template class, which takes as template argument
+the class of the object that will be used as the callback when the asynchronous
+operation completes. This object can be of any type, but must include an
+operator() method with the signature:
+
+    operator()(boost::system::error_code ec, size_t length)
+
+... the two arguments being the status of the completed I/O operation and the
+number of bytes transferred (in the case of the open method, the second argument
+will be zero).
+
+Finally, the TCPSocket and UDPSocket classes provide the body of the
+asynchronous operations.
+
+Fetch Sequence
+--------------
+The fetch is implemented by the IOFetch class which takes as argument the
+protocol to use. The sequence is:
+
+    REENTER:
+        render the question into a wire-format query packet
+        open()                           // Open socket and optionally connect
+        if (! synchronous) {
+            YIELD;
+        }
+        YIELD asyncSend(query)           // Send query
+        do {
+            YIELD asyncReceive(response) // Read response
+        } while (! complete(response))
+        close()                          // Drop connection and close socket
+        server->resume
+
+The open() method opens a socket for use.  On TCP, it also makes a connection to
+the remote end.  So under UDP the operation will complete immediately, but under
+TCP it could take a long time. One solution would befor the open operation to
+post an event to the I/O queue; then both cases could be regarded as being
+equivalent, with the completion being signalled by the posting of the completion
+event. However UDP is the most common case and that would involve extra overhead.
+So the open() returns a status indicating whether the operation completed
+asynchronously. If it did, the code yields back to the coroutine; if not the
+yield is bypassed.
+
+The asynchronous send is straightforward, invoking the underlying ASIO function.
+Note that the address/port is supplied to both the open() and asyncSend()
+methods - it is used by the TCPSocket in open() and by the UDPSocket in
+asyncSend().
+
+The asyncReceive() method issues an asynchronous read and waits for completion.
+The fetch object keeps track of the amount of data received so far and when the
+receive completes it calls a method on the socket to determine if the entire
+message has been received. This will always be the case for UDP. On TCP though,
+the message is preceded by a count field as several reads may be required to
+read all the data. The fetch loops until all the data is read.
+
+Finally, the socket is closed and the server called to resume operation.
index 1041e2499919c5914a0912fe431eb0de532eb190..742abc66e9ccb3c2ab9ef2502bd0355d0f0ac834 100644 (file)
@@ -20,7 +20,6 @@
 #include <dns/opcode.h>
 #include <cryptolink/crypto_rng.h>
 #include <dns/rcode.h>
-#include <util/buffer.h>
 #include <util/io.h>
 
 #include <boost/scoped_ptr.hpp>
 #include <stdint.h>
 #include <sys/socket.h>
 
-using namespace boost::asio;
 using namespace isc::asiolink;
 using namespace isc::dns;
-using namespace isc::util;
 using namespace isc::log;
+using namespace isc::util;
+
+using namespace boost::asio;
 using namespace std;
 
 namespace isc {
 namespace asiodns {
 
-// Log debug verbosity
+// Log debug verbosity.
 
 const int DBG_IMPORTANT = DBGLVL_TRACE_BASIC;
 const int DBG_COMMON = DBGLVL_TRACE_DETAIL;
 const int DBG_ALL = DBGLVL_TRACE_DETAIL + 20;
 
-/// \brief IOFetch Data
+/// @brief IOFetch Data
 ///
 /// The data for IOFetch is held in a separate struct pointed to by a shared_ptr
 /// object.  This is because the IOFetch object will be copied often (it is used
@@ -56,111 +56,94 @@ const int DBG_ALL = DBGLVL_TRACE_DETAIL + 20;
 /// want keep the same data).  Organising the data in this way keeps copying to
 /// a minimum.
 struct IOFetchData : boost::noncopyable {
-    IOServicePtr                  io_service_;       ///< The IO service
+    IOServicePtr                  io_service_;       // The IO service
     // The first two members are shared pointers to a base class because what is
     // actually instantiated depends on whether the fetch is over UDP or TCP,
     // which is not known until construction of the IOFetch.  Use of a shared
     // pointer here is merely to ensure deletion when the data object is deleted.
-    boost::scoped_ptr<IOAsioSocket<IOFetch>> socket; ///< Socket to use for I/O
-    boost::scoped_ptr<IOEndpoint> remote_snd;        ///< Where the fetch is sent
-    boost::scoped_ptr<IOEndpoint> remote_rcv;        ///< Where the response came from
-    OutputBufferPtr               msgbuf;            ///< Wire buffer for question
-    OutputBufferPtr               received;          ///< Received data put here
-    IOFetch::Callback*            callback;          ///< Called on I/O Completion
-    boost::asio::deadline_timer   timer;             ///< Timer to measure timeouts
-    IOFetch::Protocol             protocol;          ///< Protocol being used
-    size_t                        cumulative;        ///< Cumulative received amount
-    size_t                        expected;          ///< Expected amount of data
-    size_t                        offset;            ///< Offset to receive data
-    bool                          stopped;           ///< Have we stopped running?
-    int                           timeout;           ///< Timeout in ms
-    bool                          packet;            ///< true if packet was supplied
+    boost::scoped_ptr<IOAsioSocket<IOFetch>> socket; // Socket to use for I/O
+    boost::scoped_ptr<IOEndpoint> remote_snd;        // Where the fetch is sent
+    boost::scoped_ptr<IOEndpoint> remote_rcv;        // Where the response came from
+    OutputBufferPtr               msgbuf;            // Wire buffer for question
+    OutputBufferPtr               received;          // Received data put here
+    IOFetch::Callback*            callback;          // Called on I/O Completion
+    boost::asio::deadline_timer   timer;             // Timer to measure timeouts
+    IOFetch::Protocol             protocol;          // Protocol being used
+    size_t                        cumulative;        // Cumulative received amount
+    size_t                        expected;          // Expected amount of data
+    size_t                        offset;            // Offset to receive data
+    bool                          stopped;           // Have we stopped running?
+    int                           timeout;           // Timeout in ms
+    bool                          packet;            // true if packet was supplied
 
     // In case we need to log an error, the origin of the last asynchronous
     // I/O is recorded.  To save time and simplify the code, this is recorded
     // as the ID of the error message that would be generated if the I/O failed.
     // This means that we must make sure that all possible "origins" take the
     // same arguments in their message in the same order.
-    isc::log::MessageID         origin;     ///< Origin of last asynchronous I/O
+    isc::log::MessageID         origin;              // Origin of last asynchronous I/O
     uint8_t                     staging[IOFetch::STAGING_LENGTH];
-                                            ///< Temporary array for received data
-    isc::dns::qid_t             qid;        ///< The QID set in the query
+                                                     // Temporary array for received data
+    isc::dns::qid_t             qid;                 // The QID set in the query
 
-    /// \brief Constructor
+    /// @brief Constructor.
     ///
-    /// Just fills in the data members of the IOFetchData structure
+    /// Just fills in the data members of the IOFetchData structure.
     ///
-    /// \param proto Either IOFetch::TCP or IOFetch::UDP.
-    /// \param service I/O Service object to handle the asynchronous
+    /// @param proto Either IOFetch::TCP or IOFetch::UDP.
+    /// @param service I/O Service object to handle the asynchronous
     ///        operations.
-    /// \param address IP address of upstream server
-    /// \param port Port to use for the query
-    /// \param buff Output buffer into which the response (in wire format)
+    /// @param address IP address of upstream server.
+    /// @param port Port to use for the query.
+    /// @param buff Output buffer into which the response (in wire format)
     ///        is written (if a response is received).
-    /// \param cb Callback object containing the callback to be called
+    /// @param cb Callback object containing the callback to be called
     ///        when we terminate.  The caller is responsible for managing this
     ///        object and deleting it if necessary.
-    /// \param wait Timeout for the fetch (in ms).
+    /// @param wait Timeout for the fetch (in ms).
     ///
-    /// TODO: May need to alter constructor (see comment 4 in Trac ticket #554)
+    /// TODO: May need to alter constructor (see comment 4 in Trac ticket #554).
     IOFetchData(IOFetch::Protocol proto, const IOServicePtr& service,
-        const IOAddress& address, uint16_t port, OutputBufferPtr& buff,
-        IOFetch::Callback* cb, int wait) : io_service_(service),
-        socket((proto == IOFetch::UDP) ?
-            static_cast<IOAsioSocket<IOFetch>*>(
-                new UDPSocket<IOFetch>(io_service_)) :
-            static_cast<IOAsioSocket<IOFetch>*>(
-                new TCPSocket<IOFetch>(io_service_))
-            ),
+                const IOAddress& address, uint16_t port, OutputBufferPtr& buff,
+                IOFetch::Callback* cb, int wait) :
+        io_service_(service), socket((proto == IOFetch::UDP) ?
+            static_cast<IOAsioSocket<IOFetch>*>(new UDPSocket<IOFetch>(io_service_)) :
+            static_cast<IOAsioSocket<IOFetch>*>(new TCPSocket<IOFetch>(io_service_))),
         remote_snd((proto == IOFetch::UDP) ?
             static_cast<IOEndpoint*>(new UDPEndpoint(address, port)) :
-            static_cast<IOEndpoint*>(new TCPEndpoint(address, port))
-            ),
+            static_cast<IOEndpoint*>(new TCPEndpoint(address, port))),
         remote_rcv((proto == IOFetch::UDP) ?
             static_cast<IOEndpoint*>(new UDPEndpoint(address, port)) :
-            static_cast<IOEndpoint*>(new TCPEndpoint(address, port))
-            ),
-        msgbuf(new OutputBuffer(512)),
-        received(buff),
-        callback(cb),
-        timer(io_service_->getInternalIOService()),
-        protocol(proto),
-        cumulative(0),
-        expected(0),
-        offset(0),
-        stopped(false),
-        timeout(wait),
-        packet(false),
-        origin(ASIODNS_UNKNOWN_ORIGIN),
-        staging(),
-        qid(cryptolink::generateQid()) {
+            static_cast<IOEndpoint*>(new TCPEndpoint(address, port))),
+        msgbuf(new OutputBuffer(512)), received(buff), callback(cb),
+        timer(io_service_->getInternalIOService()), protocol(proto), cumulative(0),
+        expected(0), offset(0), stopped(false), timeout(wait), packet(false),
+        origin(ASIODNS_UNKNOWN_ORIGIN), staging(), qid(cryptolink::generateQid()) {
     }
 
-    /// \brief Destructor
+    /// @brief Destructor
     ~IOFetchData() {
         timer.cancel();
     }
 
-    // Checks if the response we received was ok;
-    // - data contains the buffer we read, as well as the address
-    // we sent to and the address we received from.
-    // length is provided by the operator() in IOFetch.
-    // Addresses must match, number of octets read must be at least
-    // 2, and the first two octets must match the qid of the message
-    // we sent.
+    /// @brief Checks if the response we received was ok.
+    ///
+    /// The data member contains the buffer we read, as well as the address we
+    /// sent to and the address we received from, length is provided by the
+    /// operator() in IOFetch.
+    /// The addresses must match, number of octets read must be at least two,
+    /// and they must match the qid of the message we sent.
     bool responseOK() {
         return (*remote_snd == *remote_rcv && cumulative >= 2 &&
                 readUint16(received->getData(), received->getLength()) == qid);
     }
 };
 
-/// IOFetch Constructor - just initialize the private data
-
 IOFetch::IOFetch(Protocol protocol, const IOServicePtr& service,
     const isc::dns::Question& question, const IOAddress& address,
     uint16_t port, OutputBufferPtr& buff, Callback* cb, int wait, bool edns) {
-    MessagePtr query_msg(new Message(Message::RENDER));
-    initIOFetch(query_msg, protocol, service, question, address, port, buff,
+    MessagePtr query(new Message(Message::RENDER));
+    initIOFetch(query, protocol, service, question, address, port, buff,
                 cb, wait, edns);
 }
 
@@ -174,57 +157,46 @@ IOFetch::IOFetch(Protocol protocol, const IOServicePtr& service,
 }
 
 IOFetch::IOFetch(Protocol protocol, const IOServicePtr& service,
-    ConstMessagePtr query_message, const IOAddress& address, uint16_t port,
-    OutputBufferPtr& buff, Callback* cb, int wait) {
-    MessagePtr msg(new Message(Message::RENDER));
-
-    msg->setHeaderFlag(Message::HEADERFLAG_RD,
-                       query_message->getHeaderFlag(Message::HEADERFLAG_RD));
-    msg->setHeaderFlag(Message::HEADERFLAG_CD,
-                       query_message->getHeaderFlag(Message::HEADERFLAG_CD));
-
-    initIOFetch(msg, protocol, service,
-                **(query_message->beginQuestion()),
-                address, port, buff, cb, wait);
+                 ConstMessagePtr query_message, const IOAddress& address,
+                 uint16_t port, OutputBufferPtr& buff, Callback* cb, int wait) {
+    MessagePtr question(new Message(Message::RENDER));
+    question->setHeaderFlag(Message::HEADERFLAG_RD,
+                            query_message->getHeaderFlag(Message::HEADERFLAG_RD));
+    question->setHeaderFlag(Message::HEADERFLAG_CD,
+                            query_message->getHeaderFlag(Message::HEADERFLAG_CD));
+
+    initIOFetch(question, protocol, service, **(query_message->beginQuestion()), address,
+                port, buff, cb, wait);
 }
 
 void
-IOFetch::initIOFetch(MessagePtr& query_msg, Protocol protocol,
-                     const IOServicePtr& service,
-                     const isc::dns::Question& question,
-                     const IOAddress& address, uint16_t port,
+IOFetch::initIOFetch(MessagePtr& query, Protocol protocol, const IOServicePtr& service,
+                     const isc::dns::Question& question, const IOAddress& address, uint16_t port,
                      OutputBufferPtr& buff, Callback* cb, int wait, bool edns) {
-    data_ = boost::shared_ptr<IOFetchData>(new IOFetchData(
-        protocol, service, address, port, buff, cb, wait));
-
-    query_msg->setQid(data_->qid);
-    query_msg->setOpcode(Opcode::QUERY());
-    query_msg->setRcode(Rcode::NOERROR());
-    query_msg->setHeaderFlag(Message::HEADERFLAG_RD);
-    query_msg->addQuestion(question);
+    data_ = boost::shared_ptr<IOFetchData>(new IOFetchData(protocol, service, address, port, buff, cb, wait));
+    query->setQid(data_->qid);
+    query->setOpcode(Opcode::QUERY());
+    query->setRcode(Rcode::NOERROR());
+    query->setHeaderFlag(Message::HEADERFLAG_RD);
+    query->addQuestion(question);
 
     if (edns) {
         EDNSPtr edns_query(new EDNS());
         edns_query->setUDPSize(Message::DEFAULT_MAX_EDNS0_UDPSIZE);
-        query_msg->setEDNS(edns_query);
+        query->setEDNS(edns_query);
     }
 
-    MessageRenderer renderer;
-    renderer.setBuffer(data_->msgbuf.get());
-    query_msg->toWire(renderer);
-    renderer.setBuffer(NULL);
+    MessageRenderer r;
+    r.setBuffer(data_->msgbuf.get());
+    query->toWire(r);
+    r.setBuffer(NULL);
 }
 
-// Return protocol in use.
-
 IOFetch::Protocol
 IOFetch::getProtocol() const {
     return (data_->protocol);
 }
 
-/// The function operator is implemented with the "stackless coroutine"
-/// pattern; see boost/asio/coroutine.hpp for details.
-
 void
 IOFetch::operator()(boost::system::error_code ec, size_t length) {
     if (data_->stopped) {
@@ -320,13 +292,6 @@ IOFetch::operator()(boost::system::error_code ec, size_t length) {
     }
 }
 
-// Function that stops the coroutine sequence.  It is called either when the
-// query finishes or when the timer times out.  Either way, it sets the
-// "stopped_" flag and cancels anything that is in progress.
-//
-// As the function may be entered multiple times as things wind down, it checks
-// if the stopped_ flag is already set.  If it is, the call is a no-op.
-
 void
 IOFetch::stop(Result result) {
     if (!data_->stopped) {
@@ -385,8 +350,6 @@ IOFetch::stop(Result result) {
     }
 }
 
-// Log an error - called on I/O failure
-
 void IOFetch::logIOFailure(boost::system::error_code ec) {
     // Should only get here with a known error code.
     if ((data_->origin != ASIODNS_OPEN_SOCKET) &&
@@ -403,5 +366,5 @@ void IOFetch::logIOFailure(boost::system::error_code ec) {
         arg(data_->remote_snd->getPort());
 }
 
-} // namespace asiodns
-} // namespace isc {
+}  // namespace asiodns
+}  // namespace isc
index 57ed3c050e04a58d28632dcdf08a5a23285196b4..22ace29c4f441cc6682d3762a89fdd49a5a5df4e 100644 (file)
@@ -5,14 +5,10 @@
 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 #ifndef IO_FETCH_H
-#define IO_FETCH_H 1
+#define IO_FETCH_H
 
 #include <config.h>
 
-#include <boost/shared_array.hpp>
-#include <boost/shared_ptr.hpp>
-#include <boost/date_time/posix_time/posix_time_types.hpp>
-
 // We want to use coroutine.hpp from the system's boost headers if possible.
 // However, very old Boost versions (provided by RHEL 7 or CentOS 7) didn't have
 // this header. So we can resort to our bundled version, but only if necessary.
 #include <ext/coroutine/coroutine.hpp>
 #endif
 
-#include <boost/system/error_code.hpp>
 #include <asiolink/io_address.h>
 #include <asiolink/io_service.h>
-
-#include <util/buffer.h>
-#include <dns/question.h>
 #include <dns/message.h>
+#include <dns/question.h>
+#include <util/buffer.h>
+
+#include <boost/shared_array.hpp>
+#include <boost/shared_ptr.hpp>
+#include <boost/date_time/posix_time/posix_time_types.hpp>
+#include <boost/system/error_code.hpp>
 
 namespace isc {
 namespace asiodns {
@@ -36,211 +35,226 @@ namespace asiodns {
 // Forward declarations
 struct IOFetchData;
 
-/// \brief Upstream Fetch Processing
+/// @brief Upstream Fetch Processing.
 ///
 /// IOFetch is the class used to send upstream fetches and to handle responses.
-///
-/// \param E Endpoint type to use.
-
 class IOFetch : public boost::asio::coroutine {
 public:
-    /// \brief Protocol to use on the fetch
+    /// @brief Protocol to use on the fetch
     enum Protocol {
         UDP = 0,
         TCP = 1
     };
 
-    /// \brief Origin of Asynchronous I/O Call
+    /// @brief Origin of Asynchronous I/O Call.
     ///
-    /// Indicates what initiated an asynchronous I/O call and used in deciding
-    /// what error message to output if the I/O fails.
+    /// Indicates what initiated an asynchronous I/O call and used in deciding what
+    /// error message to output if the I/O fails.
     enum Origin {
-        NONE = 0,           ///< No asynchronous call outstanding
+        NONE = 0,          // No asynchronous call outstanding
         OPEN = 1,
         SEND = 2,
         RECEIVE = 3,
         CLOSE = 4
     };
 
-    /// \brief Result of Upstream Fetch
+    /// @brief Result of Upstream Fetch.
     ///
-    /// Note that this applies to the status of I/Os in the fetch - a fetch
-    /// that resulted in a packet being received from the server is a SUCCESS,
-    /// even if the contents of the packet indicate that some error occurred.
+    /// @note that this applies to the status of I/Os in the fetch - a fetch that
+    /// resulted in a packet being received from the server is a SUCCESS, even if
+    /// the contents of the packet indicate that some error occurred.
     enum Result {
-        SUCCESS = 0,        ///< Success, fetch completed
-        TIME_OUT = 1,       ///< Failure, fetch timed out
-        STOPPED = 2,        ///< Control code, fetch has been stopped
-        NOTSET = 3          ///< For testing, indicates value not set
+        SUCCESS = 0,       // Success, fetch completed
+        TIME_OUT = 1,      // Failure, fetch timed out
+        STOPPED = 2,       // Control code, fetch has been stopped
+        NOTSET = 3         // For testing, indicates value not set
     };
 
-    // The next enum is a "trick" to allow constants to be defined in a class
-    // declaration.
+    /// @note The next enum is a "trick" to allow constants to be defined in a class
+    /// declaration.
 
-    /// \brief Integer Constants
+    /// @brief Integer Constants.
     enum {
-        STAGING_LENGTH = 8192   ///< Size of staging buffer
+        STAGING_LENGTH = 8192   // Size of staging buffer
     };
 
-    /// \brief I/O Fetch Callback
+    /// @brief I/O Fetch Callback.
     ///
-    /// Class of callback object for when the fetch itself has completed - an
-    /// object of this class is passed to the IOFetch constructor and its
-    /// operator() method called when the fetch completes.
+    /// Class of callback object for when the fetch itself has completed - an object
+    /// of this class is passed to the IOFetch constructor and its operator() method
+    /// called when the fetch completes.
     ///
-    /// Note the difference between the two operator() methods:
-    /// - IOFetch::operator() callback is called when an asynchronous I/O has
-    ///   completed.
-    /// - IOFetch::Callback::operator() is called when an upstream fetch - which
-    ///   may have involved several asynchronous I/O operations - has completed.
+    /// @note The difference between the two operator() methods:
+    /// - IOFetch::operator() callback is called when an asynchronous I/O has completed.
+    /// - IOFetch::Callback::operator() is called when an upstream fetch - which may
+    ///   have involved several asynchronous I/O operations - has completed.
     ///
     /// This is an abstract class.
     class Callback {
     public:
-        /// \brief Default Constructor
-        Callback()
-        {}
+        /// @brief Constructor.
+        Callback() = default;
 
-        /// \brief Virtual Destructor
-        virtual ~Callback()
-        {}
+        /// @brief Destructor.
+        virtual ~Callback() = default;
 
-        /// \brief Callback method
+        /// @brief Callback method.
         ///
-        /// This is the method called when the fetch completes.
+        /// This method is called when the fetch completes.
         ///
-        /// \param result Result of the fetch
+        /// @param result Result of the fetch.
         virtual void operator()(Result result) = 0;
     };
 
-    /// \brief Constructor.
+    /// @brief Constructor.
     ///
     /// Creates the object that will handle the upstream fetch.
     ///
-    /// \param protocol Fetch protocol, either IOFetch::TCP or IOFetch::UDP
-    /// \param service I/O Service object to handle the asynchronous
+    /// @param protocol Fetch protocol, either IOFetch::TCP or IOFetch::UDP.
+    /// @param service I/O Service object to handle the asynchronous
     ///        operations.
-    /// \param question DNS question to send to the upstream server.
-    /// \param address IP address of upstream server
-    /// \param port Port to which to connect on the upstream server
-    /// \param buff Output buffer into which the response (in wire format)
+    /// @param question DNS question to send to the upstream server.
+    /// @param address IP address of upstream server.
+    /// @param port Port to which to connect on the upstream server.
+    /// @param buff Output buffer into which the response (in wire format)
     ///        is written (if a response is received).
-    /// \param cb Callback object containing the callback to be called when we
+    /// @param cb Callback object containing the callback to be called when we
     ///        terminate.  The caller is responsible for managing this object
     ///        and deleting it if necessary.
-    /// \param wait Timeout for the fetch (in ms).  The default value of
+    /// @param wait Timeout for the fetch (in ms).  The default value of
     ///        -1 indicates no timeout.
-    /// \param edns true if the request should be EDNS. The default value is
+    /// @param edns true if the request should be EDNS. The default value is
     ///        true.
-    IOFetch(Protocol protocol, const isc::asiolink::IOServicePtr& service,
+    IOFetch(Protocol protocol,
+            const isc::asiolink::IOServicePtr& service,
             const isc::dns::Question& question,
             const isc::asiolink::IOAddress& address,
-            uint16_t port, isc::util::OutputBufferPtr& buff, Callback* cb,
+            uint16_t port,
+            isc::util::OutputBufferPtr& buff,
+            Callback* cb,
             int wait = -1,
             bool edns = true);
 
-    /// \brief Constructor
-    ///  This constructor has one parameter "query_message", which
-    ///  is the shared_ptr to a full query message. It's different
-    ///  with above constructor which has only question section. All
-    ///  other parameters are same.
+    /// @brief Constructor
     ///
-    /// \param protocol Fetch protocol, either IOFetch::TCP or IOFetch::UDP
-    /// \param service I/O Service object to handle the asynchronous
+    /// This constructor has one parameter "query_message", which is the shared_ptr
+    /// to a full query message. It's different with above constructor which has only
+    /// question section. All other parameters are the same.
+    ///
+    /// @param protocol Fetch protocol, either IOFetch::TCP or IOFetch::UDP.
+    /// @param service I/O Service object to handle the asynchronous
     ///        operations.
-    /// \param query_message the shared_ptr to a full query message
-    ///        got from a query client.
-    /// \param address IP address of upstream server
-    /// \param port Port to which to connect on the upstream server
-    /// \param buff Output buffer into which the response (in wire format)
+    /// @param query_message the shared_ptr to a full query message got from a
+    ///        query client.
+    /// @param address IP address of upstream server.
+    /// @param port Port to which to connect on the upstream server.
+    /// @param buff Output buffer into which the response (in wire format)
     ///        is written (if a response is received).
-    /// \param cb Callback object containing the callback to be called when we
+    /// @param cb Callback object containing the callback to be called when we
     ///        terminate.  The caller is responsible for managing this object
     ///        and deleting it if necessary.
-    /// \param wait Timeout for the fetch (in ms).  The default value of
-    ///        -1 indicates no timeout.
-    IOFetch(Protocol protocol, const isc::asiolink::IOServicePtr& service,
+    /// @param wait Timeout for the fetch (in ms).  The default value of -1
+    ///        indicates no timeout.
+    IOFetch(Protocol protocol,
+            const isc::asiolink::IOServicePtr& service,
             isc::dns::ConstMessagePtr query_message,
             const isc::asiolink::IOAddress& address,
-            uint16_t port, isc::util::OutputBufferPtr& buff, Callback* cb,
+            uint16_t port,
+            isc::util::OutputBufferPtr& buff,
+            Callback* cb,
             int wait = -1);
 
-    /// \brief Constructor.
+    /// @brief Constructor.
     ///
     /// Creates the object that will handle the upstream fetch.
     ///
-    /// \param protocol Fetch protocol, either IOFetch::TCP or IOFetch::UDP
-    /// \param service I/O Service object to handle the asynchronous
+    /// @param protocol Fetch protocol, either IOFetch::TCP or IOFetch::UDP
+    /// @param service I/O Service object to handle the asynchronous
     ///     operations.
-    /// \param outpkt Packet to send to upstream server.  Note that the
+    /// @param outpkt Packet to send to upstream server.  Note that the
     ///     QID (first two bytes of the packet) may be altered in the sending.
-    /// \param buff Output buffer into which the response (in wire format)
+    /// @param buff Output buffer into which the response (in wire format)
     ///     is written (if a response is received).
-    /// \param cb Callback object containing the callback to be called
+    /// @param cb Callback object containing the callback to be called
     ///     when we terminate.  The caller is responsible for managing this
     ///     object and deleting it if necessary.
-    /// \param address IP address of upstream server
-    /// \param port Port to which to connect on the upstream server
-    /// (default = 53)
-    /// \param wait Timeout for the fetch (in ms).  The default value of
+    /// @param address IP address of upstream server.
+    /// @param port Port to which to connect on the upstream server
+    ///     (default = 53).
+    /// @param wait Timeout for the fetch (in ms).  The default value of
     ///     -1 indicates no timeout.
-    IOFetch(Protocol protocol, const isc::asiolink::IOServicePtr& service,
+    IOFetch(Protocol protocol,
+            const isc::asiolink::IOServicePtr& service,
             isc::util::OutputBufferPtr& outpkt,
             const isc::asiolink::IOAddress& address,
-            uint16_t port, isc::util::OutputBufferPtr& buff, Callback* cb,
+            uint16_t port,
+            isc::util::OutputBufferPtr& buff,
+            Callback* cb,
             int wait = -1);
 
-    /// \brief Return Current Protocol
+    /// @brief Return Current Protocol.
     ///
-    /// \return Protocol associated with this IOFetch object.
+    /// @return Protocol associated with this IOFetch object.
     Protocol getProtocol() const;
 
-    /// \brief Coroutine entry point
+    /// @brief Coroutine entry point.
     ///
     /// The operator() method is the method in which the coroutine code enters
     /// this object when an operation has been completed.
     ///
-    /// \param ec Error code, the result of the last asynchronous I/O operation.
-    /// \param length Amount of data received on the last asynchronous read
-    void operator()(boost::system::error_code ec = boost::system::error_code(), size_t length = 0);
+    /// @param ec Error code, the result of the last asynchronous I/O operation.
+    /// @param length Amount of data received on the last asynchronous read.
+    void operator()(boost::system::error_code ec = boost::system::error_code(),
+                    size_t length = 0);
 
-    /// \brief Terminate query
+    /// @brief Terminate query.
     ///
     /// This method can be called at any point.  It terminates the current
     /// query with the specified reason.
+    /// This function stops the coroutine sequence.  It is called either when the
+    /// query finishes or when the timer times out.  Either way, it sets the
+    /// "stopped_" flag and cancels anything that is in progress.
+    ///
+    /// As the function may be entered multiple times as things wind down, it checks
+    /// if the stopped_ flag is already set.  If it is, the call is a no-op.
     ///
-    /// \param reason Reason for terminating the query
+    /// @param reason Reason for terminating the query.
     void stop(Result reason = STOPPED);
 
 private:
-    /// \brief IOFetch Initialization Function.
-    /// All the parameters are same with the constructor, except
-    /// parameter "query_message"
-    /// \param query_message the message to be sent out.
-    void initIOFetch(isc::dns::MessagePtr& query_message, Protocol protocol,
+    /// @brief IOFetch Initialization Function.
+    ///
+    /// All the parameters are same with the constructor, except parameter
+    /// "query_message".
+    ///
+    /// @param query_message the message to be sent out.
+    void initIOFetch(isc::dns::MessagePtr& query_message,
+                     Protocol protocol,
                      const isc::asiolink::IOServicePtr& service,
                      const isc::dns::Question& question,
-                     const isc::asiolink::IOAddress& address, uint16_t port,
-                     isc::util::OutputBufferPtr& buff, Callback* cb, int wait,
+                     const isc::asiolink::IOAddress& address,
+                     uint16_t port,
+                     isc::util::OutputBufferPtr& buff,
+                     Callback* cb, int wait,
                      bool edns = true);
 
-    /// \brief Log I/O Failure
+    /// @brief Log I/O Failure.
     ///
-    /// Records an I/O failure to the log file
+    /// Records an I/O failure to the log file.
     ///
-    /// \param ec ASIO error code
+    /// @param ec ASIO error code.
     void logIOFailure(boost::system::error_code ec);
 
-    // Member variables.  All data is in a structure pointed to by a shared
-    // pointer.  The IOFetch object is copied a number of times during its
-    // life, and only requiring a pointer to be copied reduces overhead.
+    /// @brief data which is a structure pointed to by a shared pointer.  The IOFetch
+    /// object is copied a number of times during its life, and only requiring a
+    /// pointer to be copied reduces overhead.
     boost::shared_ptr<IOFetchData> data_;   ///< Private data
 };
 
-/// \brief Defines a pointer to an IOFetch.
+/// @brief Defines a pointer to an IOFetch.
 typedef boost::shared_ptr<IOFetch> IOFetchPtr;
 
-} // namespace asiodns
-} // namespace isc
+}  // namespace asiodns
+}  // namespace isc
 
 #endif // IO_FETCH_H
index 74517c10ea739ae9e14f2d98c3e6eaff4eb69b54..323e4536603899fb773553fcaa8621a8635f62a3 100644 (file)
@@ -32,8 +32,7 @@ run_unittests_LDADD += $(BOOST_LIBS) $(GTEST_LDADD)
 
 run_unittests_LDFLAGS = $(AM_LDFLAGS) $(CRYPTO_LDFLAGS) $(GTEST_LDFLAGS)
 
-# Note: the ordering matters: -Wno-... must follow -Wextra (defined in
-# KEA_CXXFLAGS)
+# Note: the ordering matters: -Wno-... must follow -Wextra (defined in KEA_CXXFLAGS)
 run_unittests_CXXFLAGS = $(AM_CXXFLAGS)
 if USE_GXX
 run_unittests_CXXFLAGS += -Wno-unused-parameter
index 0fcb6528127f4454e812d69229c223d04807e2d1..4fe94d421b95b4e0b785634f1d412ae496ea645f 100644 (file)
 #include <iterator>
 #include <vector>
 
-using namespace boost::asio::ip;
-using namespace boost::asio;
 using namespace isc::asiolink;
 using namespace isc::dns;
 using namespace isc::util;
+
+using namespace boost::asio;
+using namespace boost::asio::ip;
 using namespace std;
+
 namespace ph = std::placeholders;
 
 namespace isc {
@@ -760,5 +762,5 @@ TEST_F(IOFetchTest, TcpSendReceive8192ShortSend) {
 }
 
 
-} // namespace asiodns
-} // namespace isc
+}  // namespace asiodns
+}  // namespace isc
index 5d71cc9b7457fde21581ffdac96338c80161cb3c..cf3f2040f2133cdd714ee52673f0f7dbfb069833 100644 (file)
@@ -7,15 +7,13 @@
 #include <config.h>
 
 #include <gtest/gtest.h>
-#include <util/unittests/run_all.h>
 
+#include <util/unittests/run_all.h>
 #include <log/logger_support.h>
 
 int
-main(int argc, char* argv[])
-{
-    ::testing::InitGoogleTest(&argc, argv);         // Initialize Google test
-    isc::log::initLogger();                         // Initialize logging
-
+main(int argc, char* argv[]) {
+    ::testing::InitGoogleTest(&argc, argv);
+    isc::log::initLogger();
     return (isc::util::unittests::run_all());
 }
index a72728b15636b1b945f96f3a66b45829f2c00bd7..213322cb6a5f152d1cfacb801b96028fcec67ca7 100644 (file)
@@ -56,8 +56,7 @@ if HAVE_OPENSSL
 libkea_asiolink_la_SOURCES += openssl_tls.cc
 endif
 
-# Note: the ordering matters: -Wno-... must follow -Wextra (defined in
-# KEA_CXXFLAGS)
+# Note: the ordering matters: -Wno-... must follow -Wextra (defined in KEA_CXXFLAGS)
 libkea_asiolink_la_CXXFLAGS = $(AM_CXXFLAGS)
 libkea_asiolink_la_CPPFLAGS = $(AM_CPPFLAGS)
 libkea_asiolink_la_LIBADD  = $(top_builddir)/src/lib/util/libkea-util.la
index 795fad970ddaeef49a0762e68e7179036bc4a0ff..8bf33449aae2268c15193f06ae937a82f03fbf2f 100644 (file)
@@ -59,7 +59,7 @@ public:
     }
 };
 
-} // namespace asiolink
-} // namespace isc
+}  // namespace asiolink
+}  // namespace isc
 
 #endif // DUMMY_IO_CB_H
index 4b97929619dff72b1324af2822756dfe4a5f7f97..fa0d9e1b67447311556d76c2e82758c138c390a5 100644 (file)
@@ -200,5 +200,5 @@ IntervalTimer::getInterval() const {
     return (impl_->getInterval());
 }
 
-} // namespace asiolink
-} // namespace isc
+}  // namespace asiolink
+}  // namespace isc
index 494fddd11d1f5bae51b52a095b04914419b3ae7a..0b1c10c7882301c0a7fa948c304f1c98b05507e7 100644 (file)
@@ -137,6 +137,7 @@ private:
 
 typedef boost::shared_ptr<isc::asiolink::IntervalTimer> IntervalTimerPtr;
 
-} // namespace asiolink
-} // namespace isc
+}  // namespace asiolink
+}  // namespace isc
+
 #endif // ASIOLINK_INTERVAL_TIMER_H
index 0f9624034235ac08811192b0bb8a8de1e12be325..43459bfe5ab3ee38b7bd54f998e01021cfefa09a 100644 (file)
@@ -189,5 +189,5 @@ hash_value(const IOAddress& address) {
     }
 }
 
-} // namespace asiolink
-} // namespace isc
+}  // namespace asiolink
+}  // namespace isc
index 897a27f8b40909cd6e4ae8aac9b2d17cc15ca1e6..3544ebe125cd055d34e9c667f595c209acec2cb2 100644 (file)
@@ -324,6 +324,7 @@ operator<<(std::ostream& os, const IOAddress& address);
 /// \return The hash of the IOAddress.
 size_t hash_value(const IOAddress& address);
 
-} // namespace asiolink
-} // namespace isc
+}  // namespace asiolink
+}  // namespace isc
+
 #endif // IO_ADDRESS_H
index 29ca97f22681277d9a6da1f1a587ce15c1ac5185..f44f2c9135d6444b59c1769edb785c7e76aab945 100644 (file)
 // See the description of the namespace below.
 #include <config.h>
 
-#include <unistd.h>             // for some network system calls
-
-#include <functional>
-#include <string>
 
 #include <exceptions/exceptions.h>
-
-#include <util/buffer.h>
-
 #include <asiolink/io_error.h>
 #include <asiolink/io_socket.h>
+#include <util/buffer.h>
+
+#include <functional>
+#include <string>
+
+#include <unistd.h>             // for some network system calls
 
 // We want to use coroutine.hpp from the system's boost headers if possible.
 // However, very old Boost versions (provided by RHEL 7 or CentOS 7) didn't have
@@ -106,7 +105,7 @@ protected:
     IOAsioSocket() {}
 public:
     /// The destructor.
-    virtual ~IOAsioSocket() {}
+    virtual ~IOAsioSocket() = default;
     //@}
 
     /// \brief Return the "native" representation of the socket.
@@ -258,20 +257,20 @@ public:
     ///        really the TCP count field and is set to that value when enough
     ///        of a TCP message is received.  It should be initialized to -1
     ///        before the first read is executed.
-    /// \param outbuff Output buffer.  Data in the staging buffer may be copied
+    /// \param buff Output buffer.  Data in the staging buffer may be copied
     ///        to this output buffer in the call.
     ///
     /// \return true if the receive is complete, false if another receive is
-    ///         needed.  This is always true for UDP, but for TCP involves
-    ///         checking the amount of data received so far against the amount
-    ///         expected (as indicated by the two-byte count field).  If this
-    ///         method returns false, another read should be queued and data
-    ///         should be read into the staging buffer at offset given by the
-    ///         "offset" parameter.
+    ///        needed.  This is always true for UDP, but for TCP involves
+    ///        checking the amount of data received so far against the amount
+    ///        expected (as indicated by the two-byte count field).  If this
+    ///        method returns false, another read should be queued and data
+    ///        should be read into the staging buffer at offset given by the
+    ///        "offset" parameter.
     virtual bool processReceivedData(const void* staging, size_t length,
-                                     size_t& cumulative, size_t& offset,
-                                     size_t& expected,
-                                     isc::util::OutputBufferPtr& outbuff) = 0;
+                                     size_t& cumulative,
+                                     size_t& offset, size_t& expected,
+                                     isc::util::OutputBufferPtr& buff) = 0;
 
     /// \brief Cancel I/O On AsioSocket
     virtual void cancel() = 0;
@@ -375,7 +374,7 @@ private:
     const int protocol_;
 };
 
-} // namespace asiolink
-} // namespace isc
+}  // namespace asiolink
+}  // namespace isc
 
 #endif // IO_ASIO_SOCKET_H
index d236aa809f4f38ce7723afb48e2951a78baae77d..975372fe2714e54a67b4e817fd80691561c7db17 100644 (file)
@@ -64,5 +64,6 @@ operator<<(ostream& os, const IOEndpoint& endpoint) {
     os << ":" << boost::lexical_cast<string>(endpoint.getPort());
     return (os);
 }
-} // namespace asiolink
-} // namespace isc
+
+}  // namespace asiolink
+}  // namespace isc
index 8421a305ee4dd0137d50891095bf0c57eebb219a..0f5ddf701d37db16d26487782144e0029af17903 100644 (file)
@@ -174,10 +174,7 @@ public:
 /// \return A reference to the same \c std::ostream object referenced by
 /// parameter \c os after the insertion operation.
 std::ostream& operator<<(std::ostream& os, const IOEndpoint& endpoint);
-} // namespace asiolink
-} // namespace isc
+}  // namespace asiolink
+}  // namespace isc
 #endif // IO_ENDPOINT_H
 
-// Local Variables:
-// mode: c++
-// End:
index 692070c7c46f7d150f6dae6c12a96cd7420c8233..125cdd6b80c6e095f3a5325ed9edf0c92e358090 100644 (file)
@@ -22,8 +22,7 @@ public:
         isc::Exception(file, line, what) {}
 };
 
-
-} // namespace asiolink
-} // namespace isc
+}  // namespace asiolink
+}  // namespace isc
 
 #endif // IO_ERROR_H
index 6fc65f49de79c6f514749fc9cf77c01d5762d3df..3cc6012fe28d4cb2521985f40abe71964fb64745 100644 (file)
@@ -175,5 +175,5 @@ IOService::post(const std::function<void ()>& callback) {
     return (io_impl_->post(callback));
 }
 
-} // namespace asiolink
-} // namespace isc
+}  // namespace asiolink
+}  // namespace isc
index 100099f7f1977671af4c2621d693c645ff72c797..7da1f9e108b530aa33d0e5983c4dbabe0a9c4d47 100644 (file)
@@ -121,6 +121,7 @@ private:
 /// @brief Defines a smart pointer to an IOService instance.
 typedef boost::shared_ptr<IOService> IOServicePtr;
 
-} // namespace asiolink
-} // namespace isc
+}  // namespace asiolink
+}  // namespace isc
+
 #endif // ASIOLINK_IO_SERVICE_H
index f7792a9fb296ed66a99951a0c5a431a948a5a91d..8d399fbc23106fe0297bf0904a879e50f2f80c85 100644 (file)
@@ -53,5 +53,5 @@ IOSocket::getDummyTCPSocket() {
     return (socket);
 }
 
-} // namespace asiolink
-} // namespace isc
+}  // namespace asiolink
+}  // namespace isc
index 9c9cee16fdb5dc23f2edae4f33391fdd7a0a76cc..cb07c886ea3d799badb5ab8f0c50b7b1f05a7ba5 100644 (file)
@@ -122,7 +122,7 @@ public:
     static IOSocket& getDummyTCPSocket();
 };
 
-} // namespace asiolink
-} // namespace isc
+}  // namespace asiolink
+}  // namespace isc
 
 #endif // IO_SOCKET_H
index 7cbb73b2ab45718c01131c529cccaf6841101e76..453e6296731c1285bea9aba4760a16c587908951 100644 (file)
@@ -106,10 +106,6 @@ private:
     boost::asio::ip::tcp::endpoint& asio_endpoint_;
 };
 
-} // namespace asiolink
-} // namespace isc
+}  // namespace asiolink
+}  // namespace isc
 #endif // TCP_ENDPOINT_H
-
-// Local Variables:
-// mode: c++
-// End:
index 346d249897bef10ae3f1d618f2daf624b702f1c2..e56abe412d7ab4d367180c078ccec552db602f01 100644 (file)
@@ -5,30 +5,28 @@
 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 #ifndef TCP_SOCKET_H
-#define TCP_SOCKET_H 1
+#define TCP_SOCKET_H
 
 #ifndef BOOST_ASIO_HPP
 #error "asio.hpp must be included before including this, see asiolink.h as to why"
 #endif
 
-#include <netinet/in.h>
-#include <sys/socket.h>
-#include <unistd.h>             // for some IPC/network system calls
+#include <asiolink/io_asio_socket.h>
+#include <asiolink/io_endpoint.h>
+#include <asiolink/io_service.h>
+#include <asiolink/tcp_endpoint.h>
+#include <exceptions/isc_assert.h>
+#include <util/buffer.h>
+#include <util/io.h>
 
 #include <algorithm>
 #include <cstddef>
 
 #include <boost/numeric/conversion/cast.hpp>
 
-#include <util/buffer.h>
-#include <util/io.h>
-
-#include <asiolink/io_asio_socket.h>
-#include <asiolink/io_endpoint.h>
-#include <asiolink/io_service.h>
-#include <asiolink/tcp_endpoint.h>
-
-#include <exceptions/isc_assert.h>
+#include <netinet/in.h>
+#include <sys/socket.h>
+#include <unistd.h>             // for some IPC/network system calls
 
 namespace isc {
 namespace asiolink {
@@ -199,14 +197,14 @@ public:
     ///        processed.
     /// \param offset Unused.
     /// \param expected unused.
-    /// \param outbuff Output buffer.  Data in the staging buffer is be copied
+    /// \param buff Output buffer.  Data in the staging buffer is be copied
     ///        to this output buffer in the call.
     ///
     /// \return Always true
     virtual bool processReceivedData(const void* staging, size_t length,
                                      size_t& cumulative, size_t& offset,
                                      size_t& expected,
-                                     isc::util::OutputBufferPtr& outbuff);
+                                     isc::util::OutputBufferPtr& buff);
 
     /// \brief Cancel I/O On Socket
     virtual void cancel();
@@ -495,7 +493,7 @@ TCPSocket<C>::close() {
     }
 }
 
-} // namespace asiolink
-} // namespace isc
+}  // namespace asiolink
+}  // namespace isc
 
 #endif // TCP_SOCKET_H
index cad0d6d16010f0439a29802046f08febcd46de52..eac8ea73bdc43c8cfeb37a029e93144d5cfff464 100644 (file)
@@ -64,8 +64,7 @@ run_unittests_LDADD += $(GTEST_LDADD)
 
 run_unittests_LDFLAGS = $(AM_LDFLAGS) $(CRYPTO_LDFLAGS) $(GTEST_LDFLAGS)
 
-# Note: the ordering matters: -Wno-... must follow -Wextra (defined in
-# KEA_CXXFLAGS)
+# Note: the ordering matters: -Wno-... must follow -Wextra (defined in KEA_CXXFLAGS)
 run_unittests_CXXFLAGS = $(AM_CXXFLAGS)
 if USE_GXX
 run_unittests_CXXFLAGS += -Wno-unused-parameter -Wno-unused-private-field
index 1376e63283d801ec44b849a39311e930083dbe60..214dd4da045714e01f18cfbcbefe6b5b7a905765 100644 (file)
 #include <boost/date_time/posix_time/posix_time.hpp>
 #include <gtest/gtest.h>
 
+using namespace isc::asiolink;
+
 namespace {
 // TODO: Consider this margin
 const boost::posix_time::time_duration TIMER_MARGIN_MSEC =
     boost::posix_time::milliseconds(50);
 }
 
-using namespace isc::asiolink;
-
 // This fixture is for testing IntervalTimer. Some callback functors are
 // registered as callback function of the timer to test if they are called
 // or not.
index 566c7c9faafd646a84fb071f109462d6c85ae554..33e10dbc398f2d0768df1881b1580f04937340cd 100644 (file)
@@ -7,13 +7,13 @@
 #include <config.h>
 
 #include <gtest/gtest.h>
+
 #include <util/unittests/run_all.h>
-#include <log/logger_manager.h>
+#include <log/logger_support.h>
 
 int
-main(int argc, char* argv[])
-{
-    ::testing::InitGoogleTest(&argc, argv);         // Initialize Google test
-    isc::log::LoggerManager::init("unittest");      // Set a root logger name
+main(int argc, char* argv[]) {
+    ::testing::InitGoogleTest(&argc, argv);
+    isc::log::initLogger();
     return (isc::util::unittests::run_all());
 }
index 82c74ca66e29f3049e4e58a76085b3abe6245e91..f97a8f66650623c44dd0a38a9beecfb8e0bc44f4 100644 (file)
 #include <string>
 #include <vector>
 
-using namespace boost::asio;
-using namespace boost::asio::ip;
-using namespace isc::util;
 using namespace isc::asiolink;
+using namespace isc::util;
+
 using namespace std;
+using namespace boost::asio;
+using namespace boost::asio::ip;
 
 namespace {
 
index a3ea985ba3d3b59dc0b5e9fbd8750edd672f765c..c607fce92a7293517eadcc14610c292ee919deb5 100644 (file)
 #include <vector>
 
 
-using namespace boost::asio;
-using namespace isc::util;
 using namespace isc::asiolink;
+using namespace isc::util;
+
+using namespace boost::asio;
 using namespace std;
 
 namespace {
index 894032b2216065bc631ac68524ab9101460a2c7e..f2e040ee038fc58cf44f438c4db1afcc92be482a 100644 (file)
@@ -106,10 +106,6 @@ private:
     boost::asio::ip::udp::endpoint& asio_endpoint_;
 };
 
-} // namespace asiolink
-} // namespace isc
+}  // namespace asiolink
+}  // namespace isc
 #endif // UDP_ENDPOINT_H
-
-// Local Variables:
-// mode: c++
-// End:
index 9ed3c197eef091f27575ae496d7a3e37f259421a..380d344e36a713726aeb52393f9440ed8652df1e 100644 (file)
@@ -130,14 +130,14 @@ public:
     ///        processed.
     /// \param offset Unused.
     /// \param expected unused.
-    /// \param outbuff Output buffer.  Data in the staging buffer is be copied
+    /// \param buff Output buffer.  Data in the staging buffer is be copied
     ///        to this output buffer in the call.
     ///
     /// \return Always true
     virtual bool processReceivedData(const void* staging, size_t length,
                                      size_t& cumulative, size_t& offset,
                                      size_t& expected,
-                                     isc::util::OutputBufferPtr& outbuff);
+                                     isc::util::OutputBufferPtr& buff);
 
     /// \brief Cancel I/O On Socket
     virtual void cancel();
@@ -315,7 +315,7 @@ UDPSocket<C>::close() {
     }
 }
 
-} // namespace asiolink
-} // namespace isc
+}  // namespace asiolink
+}  // namespace isc
 
 #endif // UDP_SOCKET_H
index e954ea9009d7d1001f7535f24ac11b0731f24b0b..1b1e8eb3cfb52285de04f23e6a705156a2407e55 100644 (file)
@@ -1069,7 +1069,3 @@ bool operator<(const Element& a, const Element& b);
 }  // namespace isc
 
 #endif // ISC_DATA_H
-
-// Local Variables:
-// mode: c++
-// End:
index 8738b925c59da1e924c1b78cc76bb9cb98859358..c15bc5627bbf49baa428662d807210f1ee187331 100644 (file)
@@ -9,7 +9,6 @@
 #include <gtest/gtest.h>
 
 #include <cc/command_interpreter.h>
-#include <config/tests/data_def_unittests_config.h>
 #include <log/logger_name.h>
 
 #include <boost/scoped_ptr.hpp>
index 40c051fba26825f593c241f7f3ac89b185f78b0d..cf3f2040f2133cdd714ee52673f0f7dbfb069833 100644 (file)
@@ -7,14 +7,13 @@
 #include <config.h>
 
 #include <gtest/gtest.h>
+
 #include <util/unittests/run_all.h>
 #include <log/logger_support.h>
 
 int
 main(int argc, char* argv[]) {
     ::testing::InitGoogleTest(&argc, argv);
-
     isc::log::initLogger();
-
     return (isc::util::unittests::run_all());
 }
index abdfa8a5a6c34a08eed57e0a47ce41c999ecbe1b..d6d1ec87a16d87fa5b5e5226d9c5ccc3278a1396 100644 (file)
@@ -1,2 +1 @@
-/data_def_unittests_config.h
 /run_unittests
index 546c35748ad1fd97354c68409086b2de0bedc282..547d0ef1321c6dc0be6f733cd9df06cd4bac31f7 100644 (file)
@@ -1,4 +1,4 @@
-SUBDIRS = testdata .
+SUBDIRS = .
 
 AM_CPPFLAGS = -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib
 AM_CPPFLAGS += $(BOOST_INCLUDES) $(CRYPTO_CFLAGS) $(CRYPTO_INCLUDES)
@@ -12,7 +12,6 @@ AM_LDFLAGS = -static
 endif
 
 CLEANFILES = *.gcno *.gcda
-DISTCLEANFILES = data_def_unittests_config.h
 
 TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND)
 
diff --git a/src/lib/config/tests/data_def_unittests_config.h.in b/src/lib/config/tests/data_def_unittests_config.h.in
deleted file mode 100644 (file)
index 0837f84..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-// Copyright (C) 2009-2015 Internet Systems Consortium, Inc. ("ISC")
-//
-// This Source Code Form is subject to the terms of the Mozilla Public
-// License, v. 2.0. If a copy of the MPL was not distributed with this
-// file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-#define TEST_DATA_PATH "@abs_srcdir@/testdata"
index fc385f9f5e8d248b9e07bb6d204c827dee1b0e23..cf3f2040f2133cdd714ee52673f0f7dbfb069833 100644 (file)
@@ -7,6 +7,7 @@
 #include <config.h>
 
 #include <gtest/gtest.h>
+
 #include <util/unittests/run_all.h>
 #include <log/logger_support.h>
 
diff --git a/src/lib/config/tests/testdata/Makefile.am b/src/lib/config/tests/testdata/Makefile.am
deleted file mode 100644 (file)
index 641a142..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-EXTRA_DIST  = data22_1.data
-EXTRA_DIST += data22_2.data
-EXTRA_DIST += data22_3.data
-EXTRA_DIST += data22_4.data
-EXTRA_DIST += data22_5.data
-EXTRA_DIST += data22_6.data
-EXTRA_DIST += data22_7.data
-EXTRA_DIST += data22_8.data
-EXTRA_DIST += data22_9.data
-EXTRA_DIST += data22_10.data
-EXTRA_DIST += data32_1.data
-EXTRA_DIST += data32_2.data
-EXTRA_DIST += data32_3.data
-EXTRA_DIST += data33_1.data
-EXTRA_DIST += data33_2.data
-EXTRA_DIST += data41_1.data
-EXTRA_DIST += data41_2.data
-EXTRA_DIST += spec1.spec
-EXTRA_DIST += spec2.spec
-EXTRA_DIST += spec3.spec
-EXTRA_DIST += spec4.spec
-EXTRA_DIST += spec5.spec
-EXTRA_DIST += spec6.spec
-EXTRA_DIST += spec7.spec
-EXTRA_DIST += spec8.spec
-EXTRA_DIST += spec9.spec
-EXTRA_DIST += spec10.spec
-EXTRA_DIST += spec11.spec
-EXTRA_DIST += spec12.spec
-EXTRA_DIST += spec13.spec
-EXTRA_DIST += spec14.spec
-EXTRA_DIST += spec15.spec
-EXTRA_DIST += spec16.spec
-EXTRA_DIST += spec17.spec
-EXTRA_DIST += spec18.spec
-EXTRA_DIST += spec19.spec
-EXTRA_DIST += spec20.spec
-EXTRA_DIST += spec21.spec
-EXTRA_DIST += spec22.spec
-EXTRA_DIST += spec23.spec
-EXTRA_DIST += spec24.spec
-EXTRA_DIST += spec25.spec
-EXTRA_DIST += spec26.spec
-EXTRA_DIST += spec27.spec
-EXTRA_DIST += spec28.spec
-EXTRA_DIST += spec29.spec
-EXTRA_DIST += spec30.spec
-EXTRA_DIST += spec31.spec
-EXTRA_DIST += spec32.spec
-EXTRA_DIST += spec33.spec
-EXTRA_DIST += spec34.spec
-EXTRA_DIST += spec35.spec
-EXTRA_DIST += spec36.spec
-EXTRA_DIST += spec37.spec
-EXTRA_DIST += spec38.spec
-EXTRA_DIST += spec39.spec
-EXTRA_DIST += spec40.spec
-EXTRA_DIST += spec41.spec
-EXTRA_DIST += spec42.spec
diff --git a/src/lib/config/tests/testdata/data22_1.data b/src/lib/config/tests/testdata/data22_1.data
deleted file mode 100644 (file)
index 18732c7..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-{
-    "value1": 1,
-    "value2": 2.3,
-    "value3": true,
-    "value4": "foo",
-    "value5": [ 1, 2, 3 ],
-    "value6": { "v61": "bar", "v62": true },
-    "value9": { "v91": "hi", "v92": { "v92a": "Hi", "v92b": 3 } }
-}
diff --git a/src/lib/config/tests/testdata/data22_10.data b/src/lib/config/tests/testdata/data22_10.data
deleted file mode 100644 (file)
index fed4001..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-{
-    "version": 123,
-    "value1": 1,
-    "value2": 2.3,
-    "value3": true,
-    "value4": "foo",
-    "value5": [ 1, 2, 3 ],
-    "value6": { "v61": "bar", "v62": true },
-    "value8": [ { "a": "d" }, { "a": "e" } ],
-    "value9": { "v91": "hi", "v92": { "v92a": "Hi", "v92b": 3 } }
-}
diff --git a/src/lib/config/tests/testdata/data22_2.data b/src/lib/config/tests/testdata/data22_2.data
deleted file mode 100644 (file)
index c820706..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-{
-    "value1": "asdf",
-    "value2": 2.3,
-    "value3": true,
-    "value4": "foo",
-    "value5": [ 1, 2, 3 ],
-    "value6": { "v61": "bar", "v62": true }
-}
diff --git a/src/lib/config/tests/testdata/data22_3.data b/src/lib/config/tests/testdata/data22_3.data
deleted file mode 100644 (file)
index 7d57dfe..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-{
-    "value1": 1,
-    "value2": false,
-    "value3": true,
-    "value4": "foo",
-    "value5": [ 1, 2, 3 ],
-    "value6": { "v61": "bar", "v62": true }
-}
diff --git a/src/lib/config/tests/testdata/data22_4.data b/src/lib/config/tests/testdata/data22_4.data
deleted file mode 100644 (file)
index 52862d5..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-{
-    "value1": 1,
-    "value2": 2.3,
-    "value3": true,
-    "value4": "foo",
-    "value5": [ 1, 2, "a" ],
-    "value6": { "v61": "bar", "v62": true }
-}
diff --git a/src/lib/config/tests/testdata/data22_5.data b/src/lib/config/tests/testdata/data22_5.data
deleted file mode 100644 (file)
index 43937d6..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-{
-    "value1": 1,
-    "value2": 2.3,
-    "value3": true,
-    "value4": "foo",
-    "value5": [ 1, 2, 3 ],
-    "value6": { "v61": "bar", "v62": "Break" }
-}
diff --git a/src/lib/config/tests/testdata/data22_6.data b/src/lib/config/tests/testdata/data22_6.data
deleted file mode 100644 (file)
index 7b53490..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-{
-    "value1": 1,
-    "value2": 2.3,
-    "value3": true,
-    "value4": "foo",
-    "value5": [ 1, 2, 3 ],
-    "value6": { "v61": "bar", "v62": true },
-    "value7": [ 1, 2.2, "str", true ],
-    "value9": { "v91": "hi", "v92": { "v92a": "Hi", "v92b": 3 } }
-}
diff --git a/src/lib/config/tests/testdata/data22_7.data b/src/lib/config/tests/testdata/data22_7.data
deleted file mode 100644 (file)
index 98f537b..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-{
-    "value1": 1,
-    "value2": 2.3,
-    "value3": true,
-    "value4": "foo",
-    "value5": [ 1, 2, 3 ],
-    "value6": { "v61": "bar", "v62": true },
-    "value8": [ { "a": "d" }, { "a": "e" } ],
-    "value9": { "v91": "hi", "v92": { "v92a": "Hi", "v92b": 3 } }
-}
diff --git a/src/lib/config/tests/testdata/data22_8.data b/src/lib/config/tests/testdata/data22_8.data
deleted file mode 100644 (file)
index 8bc0aa9..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-{
-    "value1": 1,
-    "value2": 2.3,
-    "value3": true,
-    "value4": "foo",
-    "value5": [ 1, 2, 3 ],
-    "value6": { "v61": "bar", "v62": true },
-    "value8": [ { "a": "d" }, { "a": 1 } ],
-    "value9": { "v91": "hi", "v92": { "v92a": "Hi", "v92b": 3 } }
-}
diff --git a/src/lib/config/tests/testdata/data22_9.data b/src/lib/config/tests/testdata/data22_9.data
deleted file mode 100644 (file)
index f115194..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-{
-    "value1": 1,
-    "value2": 2.3,
-    "value3": true,
-    "value4": "foo",
-    "value5": [ 1, 2, 3 ],
-    "value6": { "v61": "bar", "v62": true },
-    "value8": [ { "a": "d" }, { "a": "e" } ],
-    "value9": { "v91": "hi", "v92": { "v92a": "Hi", "v92b": 3 } },
-    "value_does_not_exist": 1
-}
diff --git a/src/lib/config/tests/testdata/data32_1.data b/src/lib/config/tests/testdata/data32_1.data
deleted file mode 100644 (file)
index 5695b52..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-{
-    "named_set_item": { "foo": 1, "bar": 2 }
-}
diff --git a/src/lib/config/tests/testdata/data32_2.data b/src/lib/config/tests/testdata/data32_2.data
deleted file mode 100644 (file)
index d5b9765..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-{
-    "named_set_item": { "foo": "wrongtype", "bar": 2 }
-}
diff --git a/src/lib/config/tests/testdata/data32_3.data b/src/lib/config/tests/testdata/data32_3.data
deleted file mode 100644 (file)
index 85f32fe..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-{
-    "named_set_item": []
-}
diff --git a/src/lib/config/tests/testdata/data33_1.data b/src/lib/config/tests/testdata/data33_1.data
deleted file mode 100644 (file)
index 429852c..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-{
-    "dummy_str": "Dummy String",
-    "dummy_int": 118,
-    "dummy_datetime": "2011-05-27T19:42:57Z",
-    "dummy_date": "2011-05-27",
-    "dummy_time": "19:42:57"
-}
diff --git a/src/lib/config/tests/testdata/data33_2.data b/src/lib/config/tests/testdata/data33_2.data
deleted file mode 100644 (file)
index eb0615c..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-{
-    "dummy_str": "Dummy String",
-    "dummy_int": 118,
-    "dummy_datetime": "xxxx",
-    "dummy_date": "xxxx",
-    "dummy_time": "xxxx"
-}
diff --git a/src/lib/config/tests/testdata/data41_1.data b/src/lib/config/tests/testdata/data41_1.data
deleted file mode 100644 (file)
index d309854..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-{
-    "zones": {
-        "example.org": {
-            "queries.tcp": 100,
-            "queries.udp": 200
-        },
-        "example.net": {
-            "queries.tcp": 300,
-            "queries.udp": 400
-        }
-    }
-}
diff --git a/src/lib/config/tests/testdata/data41_2.data b/src/lib/config/tests/testdata/data41_2.data
deleted file mode 100644 (file)
index c64e931..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-{
-    "zones": [
-        {
-            "example.org": {
-                "queries.tcp": 100,
-                "queries.udp": 200
-            }
-        },
-        {
-            "example.net": {
-                "queries.tcp": 300,
-                "queries.udp": 400
-            }
-        }
-    ]
-}
diff --git a/src/lib/config/tests/testdata/spec1.spec b/src/lib/config/tests/testdata/spec1.spec
deleted file mode 100644 (file)
index 05a3794..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-{
-  "module_spec": {
-    "module_name": "Spec1"
-  }
-}
-
diff --git a/src/lib/config/tests/testdata/spec10.spec b/src/lib/config/tests/testdata/spec10.spec
deleted file mode 100644 (file)
index d2bac77..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-{
-  "module_spec": {
-    "module_name": "Spec2",
-    "config_data": [
-      { "item_name": "item1",
-        "item_type": "real",
-        "item_optional": false,
-        "item_default": 1
-      }
-    ]
-  }
-}
-
diff --git a/src/lib/config/tests/testdata/spec11.spec b/src/lib/config/tests/testdata/spec11.spec
deleted file mode 100644 (file)
index 61cb2c3..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-{
-  "module_spec": {
-    "module_name": "Spec2",
-    "config_data": [
-      { "item_name": "item1",
-        "item_type": "boolean",
-        "item_optional": false,
-        "item_default": 1
-      }
-    ]
-  }
-}
-
diff --git a/src/lib/config/tests/testdata/spec12.spec b/src/lib/config/tests/testdata/spec12.spec
deleted file mode 100644 (file)
index 9083a66..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-{
-  "module_spec": {
-    "module_name": "Spec2",
-    "config_data": [
-      { "item_name": "item1",
-        "item_type": "string",
-        "item_optional": false,
-        "item_default": 1
-      }
-    ]
-  }
-}
-
diff --git a/src/lib/config/tests/testdata/spec13.spec b/src/lib/config/tests/testdata/spec13.spec
deleted file mode 100644 (file)
index c13be46..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-{
-  "module_spec": {
-    "module_name": "Spec2",
-    "config_data": [
-      { "item_name": "item1",
-        "item_type": "list",
-        "item_optional": false,
-        "item_default": 1
-      }
-    ]
-  }
-}
-
diff --git a/src/lib/config/tests/testdata/spec14.spec b/src/lib/config/tests/testdata/spec14.spec
deleted file mode 100644 (file)
index 3ce1852..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-{
-  "module_spec": {
-    "module_name": "Spec2",
-    "config_data": [
-      { "item_name": "item1",
-        "item_type": "map",
-        "item_optional": false,
-        "item_default": 1
-      }
-    ]
-  }
-}
-
diff --git a/src/lib/config/tests/testdata/spec15.spec b/src/lib/config/tests/testdata/spec15.spec
deleted file mode 100644 (file)
index a9ef085..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-{
-  "module_spec": {
-    "module_name": "Spec2",
-    "config_data": [
-      { "item_name": "item1",
-        "item_type": "badname",
-        "item_optional": false,
-        "item_default": 1
-      }
-    ]
-  }
-}
-
diff --git a/src/lib/config/tests/testdata/spec16.spec b/src/lib/config/tests/testdata/spec16.spec
deleted file mode 100644 (file)
index e78bc2e..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-{
-  "module_spec": {
-    "module_name": "Spec2",
-    "config_data": 1
-  }
-}
-
diff --git a/src/lib/config/tests/testdata/spec17.spec b/src/lib/config/tests/testdata/spec17.spec
deleted file mode 100644 (file)
index 74a1c25..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-{
-  "module_spec": {
-    "module_name": "Spec2",
-    "commands": [
-      {
-        "command_description": "Print the given message to stdout",
-        "command_args": [ {
-          "item_name": "message",
-          "item_type": "string",
-          "item_optional": false,
-          "item_default": ""
-        } ]
-      }
-    ]
-  }
-}
-
diff --git a/src/lib/config/tests/testdata/spec18.spec b/src/lib/config/tests/testdata/spec18.spec
deleted file mode 100644 (file)
index e3854aa..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-{
-  "module_spec": {
-    "module_name": "Spec2",
-    "commands": [
-      {
-        "command_name": "print_message",
-        "command_description": "Print the given message to stdout"
-      }
-    ]
-  }
-}
-
diff --git a/src/lib/config/tests/testdata/spec19.spec b/src/lib/config/tests/testdata/spec19.spec
deleted file mode 100644 (file)
index 1b3c703..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-{
-  "module_spec": {
-    "module_name": "Spec2",
-    "commands": [
-      {
-        "command_name": "print_message",
-        "command_description": "Print the given message to stdout",
-        "command_args": 1
-      }
-    ]
-  }
-}
-
diff --git a/src/lib/config/tests/testdata/spec2.spec b/src/lib/config/tests/testdata/spec2.spec
deleted file mode 100644 (file)
index 482c206..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-{
-  "module_spec": {
-    "module_name": "Spec2",
-    "config_data": [
-      { "item_name": "item1",
-        "item_type": "integer",
-        "item_optional": false,
-        "item_default": 1
-      },
-      { "item_name": "item2",
-        "item_type": "real",
-        "item_optional": false,
-        "item_default": 1.1
-      },
-      { "item_name": "item3",
-        "item_type": "boolean",
-        "item_optional": false,
-        "item_default": true
-      },
-      { "item_name": "item4",
-        "item_type": "string",
-        "item_optional": false,
-        "item_default": "test"
-      },
-      { "item_name": "item5",
-        "item_type": "list",
-        "item_optional": false,
-        "item_default": [ "a", "b" ],
-        "list_item_spec": {
-          "item_name": "list_element",
-          "item_type": "string",
-          "item_optional": false,
-          "item_default": ""
-        }
-      },
-      { "item_name": "item6",
-        "item_type": "map",
-        "item_optional": false,
-        "item_default": {},
-        "map_item_spec": [
-          { "item_name": "value1",
-            "item_type": "string",
-            "item_optional": true,
-            "item_default": "default"
-          },
-          { "item_name": "value2",
-            "item_type": "integer",
-            "item_optional": true
-          }
-        ]
-      }
-    ],
-    "commands": [
-      {
-        "command_name": "print_message",
-        "command_description": "Print the given message to stdout",
-        "command_args": [ {
-          "item_name": "message",
-          "item_type": "string",
-          "item_optional": false,
-          "item_default": ""
-        } ]
-      },
-      {
-        "command_name": "shutdown",
-        "command_description": "Shut down Kea",
-        "command_args": []
-      }
-    ],
-    "statistics": [
-      {
-        "item_name": "dummy_time",
-        "item_type": "string",
-        "item_optional": false,
-        "item_default": "1970-01-01T00:00:00Z",
-        "item_title": "Dummy Time",
-        "item_description": "A dummy date time",
-        "item_format": "date-time"
-      }
-    ]
-  }
-}
-
diff --git a/src/lib/config/tests/testdata/spec20.spec b/src/lib/config/tests/testdata/spec20.spec
deleted file mode 100644 (file)
index c9d32a7..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-{
-  "module_spec": {
-    "module_name": "Spec2",
-    "commands": [
-      {
-        "command_name": "print_message",
-        "command_description": "Print the given message to stdout",
-        "command_args": [ {
-          "item_name": "message",
-          "item_type": "somethingbad",
-          "item_optional": false,
-          "item_default": ""
-        } ]
-      }
-    ]
-  }
-}
-
diff --git a/src/lib/config/tests/testdata/spec21.spec b/src/lib/config/tests/testdata/spec21.spec
deleted file mode 100644 (file)
index 0af4302..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-{
-  "module_spec": {
-    "module_name": "Spec2",
-    "commands": 1
-  }
-}
-
diff --git a/src/lib/config/tests/testdata/spec22.spec b/src/lib/config/tests/testdata/spec22.spec
deleted file mode 100644 (file)
index 687db08..0000000
+++ /dev/null
@@ -1,114 +0,0 @@
-{
-  "module_spec": {
-    "module_name": "Spec22",
-    "config_data": [
-      { "item_name": "value1",
-        "item_type": "integer",
-        "item_optional": false,
-        "item_default": 9
-      },
-      { "item_name": "value2",
-        "item_type": "real",
-        "item_optional": false,
-        "item_default": 9.9
-      },
-      { "item_name": "value3",
-        "item_type": "boolean",
-        "item_optional": false,
-        "item_default": false
-      },
-      { "item_name": "value4",
-        "item_type": "string",
-        "item_optional": false,
-        "item_default": "default_string"
-      },
-      { "item_name": "value5",
-        "item_type": "list",
-        "item_optional": false,
-        "item_default": [ "a", "b" ],
-        "list_item_spec": {
-          "item_name": "list_element",
-          "item_type": "integer",
-          "item_optional": false,
-          "item_default": 8
-        }
-      },
-      { "item_name": "value6",
-        "item_type": "map",
-        "item_optional": false,
-        "item_default": {},
-        "map_item_spec": [
-          { "item_name": "v61",
-            "item_type": "string",
-            "item_optional": false,
-            "item_default": "def"
-          },
-          { "item_name": "v62",
-            "item_type": "boolean",
-            "item_optional": false,
-            "item_default": false
-          }
-        ]
-      },
-      { "item_name": "value7",
-        "item_type": "list",
-        "item_optional": true,
-        "item_default": [ ],
-        "list_item_spec": {
-          "item_name": "list_element",
-          "item_type": "any",
-          "item_optional": true
-        }
-      },
-      { "item_name": "value8",
-        "item_type": "list",
-        "item_optional": true,
-        "item_default": [ ],
-        "list_item_spec": {
-          "item_name": "list_element",
-          "item_type": "map",
-          "item_optional": true,
-          "item_default": { "a": "b" },
-          "map_item_spec": [
-            { "item_name": "a",
-              "item_type": "string",
-              "item_optional": true,
-              "item_default": "empty"
-            }
-          ]
-        }
-      },
-      { "item_name": "value9",
-        "item_type": "map",
-        "item_optional": false,
-        "item_default": { "v91": "def", "v92": {} },
-        "map_item_spec": [
-          { "item_name": "v91",
-            "item_type": "string",
-            "item_optional": false,
-            "item_default": "def"
-          },
-          { "item_name": "v92",
-            "item_type": "map",
-            "item_optional": false,
-            "item_default": {},
-            "map_item_spec": [
-              { "item_name": "v92a",
-                "item_type": "string",
-                "item_optional": false,
-                "item_default": "Hello"
-              } ,
-              {
-                "item_name": "v92b",
-                "item_type": "integer",
-                "item_optional": false,
-                "item_default": 56176
-              }
-            ]
-          }
-        ]
-      }
-    ]
-  }
-}
-
diff --git a/src/lib/config/tests/testdata/spec23.spec b/src/lib/config/tests/testdata/spec23.spec
deleted file mode 100644 (file)
index 6791b6c..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-{
-  "module_spec": {
-    "module_name": "Spec2",
-    "commands": [
-      {
-        "command_name": "print_message",
-        "command_description": "Print the given message to stdout",
-        "command_args": [ {
-          "item_name": "message",
-          "item_type": "string",
-          "item_optional": false,
-          "item_default": ""
-        } ]
-      }
-    ]
-  }
-}
-
diff --git a/src/lib/config/tests/testdata/spec24.spec b/src/lib/config/tests/testdata/spec24.spec
deleted file mode 100644 (file)
index bcb50ba..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-{
-  "module_spec": {
-    "module_name": "Spec24",
-    "config_data": [
-      { "item_name": "item",
-        "item_type": "list",
-        "item_optional": true,
-        "list_item_spec": {
-          "item_name": "list_element",
-          "item_type": "string",
-          "item_optional": false,
-          "item_default": ""
-        }
-      }
-    ]
-  }
-}
-
diff --git a/src/lib/config/tests/testdata/spec25.spec b/src/lib/config/tests/testdata/spec25.spec
deleted file mode 100644 (file)
index 6a174d5..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-{
-  "module_spec": {
-    "module_name": "Spec25",
-    "module_description": "Just an empty module"
-  }
-}
-
diff --git a/src/lib/config/tests/testdata/spec26.spec b/src/lib/config/tests/testdata/spec26.spec
deleted file mode 100644 (file)
index 27f3c5b..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-{
-  "module_spec": {
-    "module_name": "Spec26",
-    "module_description": 1
-  }
-}
diff --git a/src/lib/config/tests/testdata/spec27.spec b/src/lib/config/tests/testdata/spec27.spec
deleted file mode 100644 (file)
index 2c73021..0000000
+++ /dev/null
@@ -1,121 +0,0 @@
-{
-  "module_spec": {
-    "module_name": "Spec27",
-    "commands": [
-    {
-        "command_name": "cmd1",
-        "command_description": "command_for_unittest",
-        "command_args": [ 
-          {
-            "item_name": "value1",
-            "item_type": "integer",
-            "item_optional": false,
-            "item_default": 9
-          },
-          { "item_name": "value2",
-            "item_type": "real",
-            "item_optional": false,
-            "item_default": 9.9
-          },
-          { "item_name": "value3",
-            "item_type": "boolean",
-            "item_optional": false,
-            "item_default": false
-          },
-          { "item_name": "value4",
-            "item_type": "string",
-            "item_optional": false,
-            "item_default": "default_string"
-          },
-          { "item_name": "value5",
-            "item_type": "list",
-            "item_optional": false,
-            "item_default": [ "a", "b" ],
-            "list_item_spec": {
-              "item_name": "list_element",
-              "item_type": "integer",
-              "item_optional": false,
-              "item_default": 8
-            }
-          },
-          { "item_name": "value6",
-            "item_type": "map",
-            "item_optional": false,
-            "item_default": {},
-            "map_item_spec": [
-              { "item_name": "v61",
-                "item_type": "string",
-                "item_optional": false,
-                "item_default": "def"
-              },
-              { "item_name": "v62",
-                "item_type": "boolean",
-                "item_optional": false,
-                "item_default": false
-              }
-            ]
-          },
-          { "item_name": "value7",
-            "item_type": "list",
-            "item_optional": true,
-            "item_default": [ ],
-            "list_item_spec": {
-              "item_name": "list_element",
-              "item_type": "any",
-              "item_optional": true
-            }
-          },
-          { "item_name": "value8",
-            "item_type": "list",
-            "item_optional": true,
-            "item_default": [ ],
-            "list_item_spec": {
-              "item_name": "list_element",
-              "item_type": "map",
-              "item_optional": true,
-              "item_default": { "a": "b" },
-              "map_item_spec": [
-                { "item_name": "a",
-                  "item_type": "string",
-                  "item_optional": true,
-                  "item_default": "empty"
-                }
-              ]
-            }
-          },
-          { "item_name": "value9",
-            "item_type": "map",
-            "item_optional": false,
-            "item_default": {},
-            "map_item_spec": [
-              { "item_name": "v91",
-                "item_type": "string",
-                "item_optional": false,
-                "item_default": "def"
-              },
-              { "item_name": "v92",
-                "item_type": "map",
-                "item_optional": false,
-                "item_default": {},
-                "map_item_spec": [
-                  { "item_name": "v92a",
-                    "item_type": "string",
-                    "item_optional": false,
-                    "item_default": "Hello"
-                  } ,
-                  {
-                    "item_name": "v92b",
-                    "item_type": "integer",
-                    "item_optional": false,
-                    "item_default": 56176
-                  }
-                ]
-              }
-            ]
-          }
-        ]
-      }
-    ]
-  }
-}
-
diff --git a/src/lib/config/tests/testdata/spec28.spec b/src/lib/config/tests/testdata/spec28.spec
deleted file mode 100644 (file)
index cc83acb..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-{
-  "module_spec": {
-    "module_name": "Spec28",
-    'commands': [ ]
-  }
-}
-
diff --git a/src/lib/config/tests/testdata/spec29.spec b/src/lib/config/tests/testdata/spec29.spec
deleted file mode 100644 (file)
index c7ae5f8..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-{
-  "module_spec": {
-    "module_name": "Spec29",
-    "config_data": [
-      { "item_name": "item1",
-        "item_type": "integer",
-        "item_optional": false,
-        "item_default": 1
-      }
-    ],
-    "commands": [
-      {
-        "command_name": "good_command",
-        "command_description": "A good command",
-        "command_args": []
-      },
-      {
-        "command_name": "bad_command",
-        "command_description": "A bad command",
-        "command_args": []
-      },
-      {
-        "command_name": "command_with_arg",
-        "command_description": "A command with an (integer) argument",
-        "command_args": [ {
-          "item_name": "number",
-          "item_type": "integer",
-          "item_optional": true,
-          "item_default": 1
-        } ]
-      }
-    ]
-  }
-}
-
diff --git a/src/lib/config/tests/testdata/spec3.spec b/src/lib/config/tests/testdata/spec3.spec
deleted file mode 100644 (file)
index b59d949..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-{
-  "module_spec": {
-    "module_name": "Spec3",
-    "config_data": [
-      {
-        "item_type": "integer",
-        "item_optional": false,
-        "item_default": 1
-      }
-    ]
-  }
-}
-
diff --git a/src/lib/config/tests/testdata/spec30.spec b/src/lib/config/tests/testdata/spec30.spec
deleted file mode 100644 (file)
index a9e00ad..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-{
-    "module_spec": {
-        "module_name": "lists",
-        "module_description": "Logging options",
-        "config_data": [
-            {
-                "item_name": "first_list_items",
-                "item_type": "list",
-                "item_optional": false,
-                "item_default": [],
-                "list_item_spec": {
-                  "item_name": "first_list_item",
-                  "item_type": "map",
-                  "item_optional": false,
-                  "item_default": {},
-                  "map_item_spec": [
-                  {  "item_name": "foo",
-                     "item_type": "string",
-                     "item_optional": false,
-                     "item_default": "foo"
-                  },
-                  { "item_name": "second_list_items",
-                    "item_type": "list",
-                    "item_optional": false,
-                    "item_default": [],
-                    "list_item_spec": {
-                      "item_name": "second_list_item",
-                      "item_type": "map",
-                      "item_optional": false,
-                      "item_default": {},
-                      "map_item_spec": [
-                      { "item_name": "final_element",
-                        "item_type": "string",
-                        "item_optional": false,
-                        "item_default": "hello"
-                      }
-                      ]
-                    }
-                  }
-                  ]
-                }
-            }
-        ]
-    }
-}
diff --git a/src/lib/config/tests/testdata/spec31.spec b/src/lib/config/tests/testdata/spec31.spec
deleted file mode 100644 (file)
index 9eebfd1..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-{
-    "module_spec": {
-        "module_name": "lists",
-        "module_description": "Logging options",
-        "config_data": [
-            {
-                "item_name": "first_list_items",
-                "item_type": "list",
-                "item_optional": false,
-                "item_default": [],
-                "list_item_spec": {
-                  "item_name": "first_list_item",
-                  "item_type": "map",
-                  "item_optional": false,
-                  "item_default": {},
-                  "map_item_spec": [
-                  {  "item_name": "foo",
-                     "item_type": "string",
-                     "item_optional": false,
-                     "item_default": "foo"
-                  },
-                  { "item_name": "second_list_items",
-                    "item_type": "list",
-                    "item_optional": false,
-                    "item_default": [],
-                    "list_item_spec": {
-                      "item_name": "second_list_item",
-                      "item_type": "map",
-                      "item_optional": false,
-                      "item_default": {},
-                      "map_item_spec": [
-                      { "item_name": "map_element",
-                        "item_type": "map",
-                        "item_optional": false,
-                        "item_default": {},
-                        "map_item_spec": [
-                        { "item_name": "list1",
-                          "item_type": "list",
-                          "item_optional": false,
-                          "item_default": [],
-                          "list_item_spec":
-                          { "item_name": "list2",
-                            "item_type": "list",
-                            "item_optional": false,
-                            "item_default": [],
-                            "list_item_spec":
-                            { "item_name": "number",
-                              "item_type": "integer",
-                              "item_optional": false,
-                              "item_default": 1
-                            }
-                          }
-                        }]
-                      }
-                      ]
-                    }
-                  }
-                  ]
-                }
-            }
-        ]
-    }
-}
diff --git a/src/lib/config/tests/testdata/spec32.spec b/src/lib/config/tests/testdata/spec32.spec
deleted file mode 100644 (file)
index 2baf1c1..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-{
-  "module_spec": {
-    "module_name": "Spec32",
-    "config_data": [
-      { "item_name": "named_set_item",
-        "item_type": "named_set",
-        "item_optional": false,
-        "item_default": { "a": 1, "b": 2 },
-        "named_set_item_spec": {
-          "item_name": "named_set_element",
-          "item_type": "integer",
-          "item_optional": false,
-          "item_default": 3
-        }
-      },
-      { "item_name": "named_set_item2",
-        "item_type": "named_set",
-        "item_optional": true,
-        "item_default": { },
-        "named_set_item_spec": {
-          "item_name": "named_set_element",
-          "item_type": "map",
-          "item_optional": false,
-          "item_default": {},
-          "map_item_spec": [
-          { "item_name": "first",
-            "item_type": "integer",
-            "item_optional": true
-          },
-          { "item_name": "second",
-            "item_type": "string",
-            "item_optional": true
-          }
-          ]
-        }
-      },
-      { "item_name": "named_set_item3",
-        "item_type": "named_set",
-        "item_optional": true,
-        "item_default": { "values": [ 1, 2, 3 ] },
-        "named_set_item_spec": {
-          "item_name": "named_set_element",
-          "item_type": "list",
-          "item_optional": false,
-          "item_default": [],
-          "list_item_spec":
-          { "item_name": "list_value",
-            "item_type": "integer",
-            "item_optional": true
-          }
-        }
-      },
-      { "item_name": "named_set_item4",
-        "item_type": "named_set",
-        "item_optional": true,
-        "item_default": {},
-        "named_set_item_spec": {
-          "item_name": "named_set_element",
-          "item_type": "named_set",
-          "item_optional": false,
-          "item_default": { "a": 1, "b": 2 },
-          "named_set_item_spec":
-          { "item_name": "named_set_element",
-            "item_type": "integer",
-            "item_optional": true
-          }
-        }
-      }
-    ]
-  }
-}
-
diff --git a/src/lib/config/tests/testdata/spec33.spec b/src/lib/config/tests/testdata/spec33.spec
deleted file mode 100644 (file)
index 3002488..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-{
-  "module_spec": {
-    "module_name": "Spec33",
-    "statistics": [
-      {
-        "item_name": "dummy_str",
-        "item_type": "string",
-        "item_optional": false,
-        "item_default": "Dummy",
-        "item_title": "Dummy String",
-        "item_description": "A dummy string"
-      },
-      {
-        "item_name": "dummy_int",
-        "item_type": "integer",
-        "item_optional": false,
-        "item_default": 0,
-        "item_title": "Dummy Integer",
-        "item_description": "A dummy integer"
-      },
-      {
-        "item_name": "dummy_datetime",
-        "item_type": "string",
-        "item_optional": false,
-        "item_default": "1970-01-01T00:00:00Z",
-        "item_title": "Dummy DateTime",
-        "item_description": "A dummy datetime",
-        "item_format": "date-time"
-      },
-      {
-        "item_name": "dummy_date",
-        "item_type": "string",
-        "item_optional": false,
-        "item_default": "1970-01-01",
-        "item_title": "Dummy Date",
-        "item_description": "A dummy date",
-        "item_format": "date"
-      },
-      {
-        "item_name": "dummy_time",
-        "item_type": "string",
-        "item_optional": false,
-        "item_default": "00:00:00",
-        "item_title": "Dummy Time",
-        "item_description": "A dummy time",
-        "item_format": "time"
-      }
-    ]
-  }
-}
diff --git a/src/lib/config/tests/testdata/spec34.spec b/src/lib/config/tests/testdata/spec34.spec
deleted file mode 100644 (file)
index dd1f3ca..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-{
-  "module_spec": {
-    "module_name": "Spec34",
-    "statistics": [
-      {
-        "item_name": "dummy_str",
-        "item_type": "string",
-        "item_optional": false,
-        "item_default": "Dummy",
-        "item_description": "A dummy string"
-      }
-    ]
-  }
-}
diff --git a/src/lib/config/tests/testdata/spec35.spec b/src/lib/config/tests/testdata/spec35.spec
deleted file mode 100644 (file)
index 86aaf14..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-{
-  "module_spec": {
-    "module_name": "Spec35",
-    "statistics": [
-      {
-        "item_name": "dummy_str",
-        "item_type": "string",
-        "item_optional": false,
-        "item_default": "Dummy",
-        "item_title": "Dummy String"
-      }
-    ]
-  }
-}
-
diff --git a/src/lib/config/tests/testdata/spec36.spec b/src/lib/config/tests/testdata/spec36.spec
deleted file mode 100644 (file)
index fb9ce26..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-{
-  "module_spec": {
-    "module_name": "Spec36",
-    "statistics": [
-      {
-        "item_name": "dummy_str",
-        "item_type": "string",
-        "item_optional": false,
-        "item_default": "Dummy",
-        "item_title": "Dummy String",
-        "item_description": "A dummy string",
-        "item_format": "dummy"
-      }
-    ]
-  }
-}
-
diff --git a/src/lib/config/tests/testdata/spec37.spec b/src/lib/config/tests/testdata/spec37.spec
deleted file mode 100644 (file)
index bc444d1..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-{
-  "module_spec": {
-    "module_name": "Spec37",
-    "statistics": 8
-  }
-}
-
diff --git a/src/lib/config/tests/testdata/spec38.spec b/src/lib/config/tests/testdata/spec38.spec
deleted file mode 100644 (file)
index 1892e88..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-{
-  "module_spec": {
-    "module_name": "Spec38",
-    "statistics": [
-      {
-        "item_name": "dummy_datetime",
-        "item_type": "string",
-        "item_optional": false,
-        "item_default": "11",
-        "item_title": "Dummy DateTime",
-        "item_description": "A dummy datetime",
-        "item_format": "date-time"
-      }
-    ]
-  }
-}
-
diff --git a/src/lib/config/tests/testdata/spec39.spec b/src/lib/config/tests/testdata/spec39.spec
deleted file mode 100644 (file)
index 1f72319..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-{
-  "module_spec": {
-    "module_name": "Spec39",
-    "config_data": [
-      { "item_name": "list",
-        "item_type": "list",
-        "item_optional": false,
-        "item_default": [],
-        "list_item_spec": {
-          "item_name": "list_item",
-          "item_type": "boolean",
-          "item_optional": false,
-          "item_default": false
-        }
-      }
-    ],
-    "commands": [],
-    "statistics": []
-  }
-}
-
diff --git a/src/lib/config/tests/testdata/spec4.spec b/src/lib/config/tests/testdata/spec4.spec
deleted file mode 100644 (file)
index 80d9b22..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-{
-  "module_spec": {
-    "module_name": "Spec2",
-    "config_data": [
-      { "item_name": "item1",
-        "item_optional": false,
-        "item_default": 1
-      }
-    ]
-  }
-}
-
diff --git a/src/lib/config/tests/testdata/spec40.spec b/src/lib/config/tests/testdata/spec40.spec
deleted file mode 100644 (file)
index 6fbec10..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-{
-  "module_spec": {
-    "module_name": "Spec40",
-    "config_data": [
-      { "item_name": "item1",
-        "item_type": "any",
-        "item_optional": false,
-        "item_default": "asdf"
-      },
-      { "item_name": "item2",
-        "item_type": "any",
-        "item_optional": true
-      },
-      { "item_name": "item3",
-        "item_type": "any",
-        "item_optional": true,
-        "item_default": null
-      }
-    ]
-  }
-}
diff --git a/src/lib/config/tests/testdata/spec41.spec b/src/lib/config/tests/testdata/spec41.spec
deleted file mode 100644 (file)
index 1c57cfe..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-{
-  "module_spec": {
-    "module_name": "Spec40",
-    "statistics": [
-      {
-        "item_name": "zones",
-        "item_type": "named_set",
-        "item_optional": false,
-        "item_default": { },
-        "item_title": "Dummy name set",
-        "item_description": "A dummy name set",
-        "named_set_item_spec": {
-          "item_name": "zonename",
-          "item_type": "map",
-          "item_optional": false,
-          "item_default": { },
-          "map_item_spec": [
-            {
-              "item_name": "queries.tcp",
-              "item_optional": false,
-              "item_type": "integer",
-              "item_default": 0
-            },
-            {
-              "item_name": "queries.udp",
-              "item_optional": false,
-              "item_type": "integer",
-              "item_default": 0
-            }
-          ]
-        }
-      }
-    ]
-  }
-}
diff --git a/src/lib/config/tests/testdata/spec42.spec b/src/lib/config/tests/testdata/spec42.spec
deleted file mode 100644 (file)
index d822465..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-{
-  "module_spec": {
-    "module_name": "Spec42",
-    "config_data": [
-      { "item_name": "list_item",
-        "item_type": "list",
-        "item_optional": true,
-        "list_item_spec": {
-          "item_name": "list_element",
-          "item_type": "string",
-          "item_optional": false,
-          "item_default": ""
-        }
-      }
-    ]
-  }
-}
diff --git a/src/lib/config/tests/testdata/spec5.spec b/src/lib/config/tests/testdata/spec5.spec
deleted file mode 100644 (file)
index 515424a..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-{
-  "module_spec": {
-    "module_name": "Spec2",
-    "config_data": [
-      { "item_name": "item1",
-        "item_type": "integer",
-        "item_default": 1
-      }
-    ]
-  }
-}
-
diff --git a/src/lib/config/tests/testdata/spec6.spec b/src/lib/config/tests/testdata/spec6.spec
deleted file mode 100644 (file)
index 631d882..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-{
-  "module_spec": {
-    "module_name": "Spec2",
-    "config_data": [
-      { "item_name": "item1",
-        "item_type": "integer",
-        "item_optional": false
-      }
-    ]
-  }
-}
-
diff --git a/src/lib/config/tests/testdata/spec7.spec b/src/lib/config/tests/testdata/spec7.spec
deleted file mode 100644 (file)
index 42f8b7a..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-{
-  "module_spec": {
-  }
-}
-
diff --git a/src/lib/config/tests/testdata/spec8.spec b/src/lib/config/tests/testdata/spec8.spec
deleted file mode 100644 (file)
index bfd870e..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-{
-}
-
diff --git a/src/lib/config/tests/testdata/spec9.spec b/src/lib/config/tests/testdata/spec9.spec
deleted file mode 100644 (file)
index 21018b8..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-{
-  "module_spec": {
-    "module_name": "Spec2",
-    "config_data": [
-      { "item_name": "item1",
-        "item_type": "integer",
-        "item_optional": false,
-        "item_default": "asdf"
-      }
-    ]
-  }
-}
-
index a58d14394285ba4a79c07c33d84261365023bf1b..3933768c3c147ed8ef74b09092d550639a21e3bc 100644 (file)
@@ -28,6 +28,7 @@ libcb_unittests_LDADD  = $(top_builddir)/src/lib/database/libkea-database.la
 libcb_unittests_LDADD += $(top_builddir)/src/lib/cc/libkea-cc.la
 libcb_unittests_LDADD += $(top_builddir)/src/lib/asiolink/libkea-asiolink.la
 libcb_unittests_LDADD += $(top_builddir)/src/lib/log/libkea-log.la
+libcb_unittests_LDADD += $(top_builddir)/src/lib/util/unittests/libutil_unittests.la
 libcb_unittests_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
 libcb_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
 libcb_unittests_LDADD += $(LOG4CPLUS_LIBS) $(BOOST_LIBS) $(GTEST_LDADD)
index 6754d66eb20dab39be3f50352fd6c5b99ad7f4d9..1ccf6d1503d703091d5a09e840dc0c4600b136e4 100644 (file)
@@ -6,14 +6,14 @@
 
 #include <config.h>
 
-#include <log/logger_support.h>
 #include <gtest/gtest.h>
 
+#include <util/unittests/run_all.h>
+#include <log/logger_support.h>
+
 int
 main(int argc, char* argv[]) {
     ::testing::InitGoogleTest(&argc, argv);
-
-    int result = RUN_ALL_TESTS();
-
-    return (result);
+    isc::log::initLogger();
+    return (isc::util::unittests::run_all());
 }
index 984119827b31af4e7fa0f3c51719ded9d0882e19..7c2f596978de1fceda5bda4bfc139aabe8eee73c 100644 (file)
 namespace isc {
 namespace cryptolink {
 
-/// \brief Hash algorithm identifiers
+/// @brief Hash algorithm identifiers.
 enum HashAlgorithm {
-    UNKNOWN_HASH = 0,   ///< This value can be used in conversion
-                        ///  functions, to be returned when the
-                        ///  input is unknown (but a value MUST be
-                        ///  returned), for instance when the input
-                        ///  is a Name or a string, and the return
-                        ///  value is a HashAlgorithm.
-    MD5 = 1,            ///< MD5
-    SHA1 = 2,           ///< SHA-1
-    SHA256 = 3,         ///< SHA-256
-    SHA224 = 4,         ///< SHA-224
-    SHA384 = 5,         ///< SHA-384
-    SHA512 = 6          ///< SHA-512
-
+    UNKNOWN_HASH = 0,   // This value can be used in conversion
+                        // functions, to be returned when the
+                        // input is unknown (but a value MUST be
+                        // returned), for instance when the input
+                        // is a Name or a string, and the return
+                        // value is a HashAlgorithm.
+    MD5 = 1,            // MD5
+    SHA1 = 2,           // SHA-1
+    SHA256 = 3,         // SHA-256
+    SHA224 = 4,         // SHA-224
+    SHA384 = 5,         // SHA-384
+    SHA512 = 6          // SHA-512
 };
 
-/// \brief Forward declaration for createHash()
+/// @brief Forward declaration for createHash().
 class Hash;
 
-/// \brief Forward declaration for createHMAC()
+/// @brief Forward declaration for createHMAC().
 class HMAC;
 
-/// \brief Forward declaration for getRNG()
+/// @brief Forward declaration for getRNG().
 class RNG;
 
-/// \brief Type representing the pointer to the RNG.
+/// @brief Type representing the pointer to the RNG.
 typedef boost::shared_ptr<RNG> RNGPtr;
 
-/// General exception class that is the base for all crypto-related
+/// @brief General exception class that is the base for all crypto-related
 /// exceptions
 class CryptoLinkError : public Exception {
 public:
@@ -56,7 +55,7 @@ public:
         isc::Exception(file, line, what) {}
 };
 
-/// This exception is thrown if there was a problem initializing the
+/// @brief This exception is thrown if there was a problem initializing the
 /// crypto library
 class InitializationError : public CryptoLinkError {
 public:
@@ -64,7 +63,7 @@ public:
         CryptoLinkError(file, line, what) {}
 };
 
-/// This exception is thrown when a cryptographic action is requested
+/// @brief This exception is thrown when a cryptographic action is requested
 /// for an algorithm that is not supported by the underlying library.
 class UnsupportedAlgorithm : public CryptoLinkError {
 public:
@@ -72,7 +71,7 @@ public:
         CryptoLinkError(file, line, what) {}
 };
 
-/// This exception is thrown when the underlying library could not
+/// @brief This exception is thrown when the underlying library could not
 /// handle the key data.
 class BadKey : public CryptoLinkError {
 public:
@@ -80,7 +79,7 @@ public:
         CryptoLinkError(file, line, what) {}
 };
 
-/// This exception is raised when a general error that was not
+/// @brief This exception is raised when a general error that was not
 /// specifically caught is thrown by the underlying library. It
 /// is replaced by this one so as not have 'external' exceptions
 /// bubbling up
@@ -90,16 +89,16 @@ public:
         CryptoLinkError(file, line, what) {}
 };
 
-/// \brief Forward declarations for CryptoLink pimpl.
+/// @brief Forward declarations for CryptoLink pimpl.
 class CryptoLinkImpl;
 
-/// \brief Type representing the pointer to the CryptoLinkImpl.
+/// @brief Type representing the pointer to the CryptoLinkImpl.
 typedef boost::shared_ptr<CryptoLinkImpl> CryptoLinkImplPtr;
 
-/// \brief Forward declarations for RNG pimpl.
+/// @brief Forward declarations for RNG pimpl.
 class RNGImpl;
 
-/// \brief Singleton entry point and factory class
+/// @brief Singleton entry point and factory class
 ///
 /// This is a singleton class that serves as the entry point to
 /// the underlying cryptography library, and as a factory for objects
@@ -128,15 +127,15 @@ class RNGImpl;
 /// sure you do not forget this, is to place the result of the create
 /// functions in a shared_ptr with the corresponding deleter function.
 ///
-/// \note All other classes within cryptolink should have private
+/// @note All other classes within cryptolink should have private
 /// constructors as well, and should have a factory function from
 /// CryptoLink, and a deleter function.
 ///
-// Internal note: we can use this class later to initialize and manage
-// dynamic (PKCS#11) libs
+/// Internal note: we can use this class later to initialize and manage
+/// dynamic (PKCS#11) libs.
 class CryptoLink : private boost::noncopyable {
 public:
-    /// \brief Returns a reference to the singleton instance
+    /// @brief Returns a reference to the singleton instance.
     ///
     /// If the library has not been initialized yet, it will be
     /// initialized with some default values.
@@ -144,15 +143,17 @@ public:
     /// Since this class is noncopyable, you must use the return
     /// value directly, or store it in a reference variable.
     ///
-    /// \exception InitializationError if initialization fails
+    /// @throw InitializationError if initialization fails.
     ///
-    /// \return Reference to the singleton instance
+    /// @return Reference to the singleton instance.
     static CryptoLink& getCryptoLink();
 
-    /// \brief Get version string
+    /// @brief Get version string.
+    ///
+    /// @return The version as string.
     static std::string getVersion();
 
-    /// \brief Factory function for Hash objects
+    /// @brief Factory function for Hash objects.
     ///
     /// CryptoLink objects cannot be constructed directly. This
     /// function creates a new Hash object usable for signing or
@@ -164,17 +165,19 @@ public:
     ///
     /// If you want to safely delete objects created with this method,
     /// you can use the function deleteHash() as defined in
-    /// crypto_hash.h
+    /// crypto_hash.h.
+    ///
+    /// @throw UnsupportedAlgorithmException if the given algorithm
+    ///        is unknown or not supported by the underlying library.
+    /// @throw LibraryError if there was any unexpected exception
+    ///        in the underlying library.
     ///
-    /// \exception UnsupportedAlgorithmException if the given algorithm
-    ///            is unknown or not supported by the underlying library
-    /// \exception LibraryError if there was any unexpected exception
-    ///                         in the underlying library
+    /// @param hash_algorithm The hash algorithm.
     ///
-    /// \param hash_algorithm The hash algorithm
+    /// @return The new hash.
     Hash* createHash(const HashAlgorithm hash_algorithm);
 
-    /// \brief Factory function for HMAC objects
+    /// @brief Factory function for HMAC objects
     ///
     /// CryptoLink objects cannot be constructed directly. This
     /// function creates a new HMAC object usable for signing or
@@ -187,58 +190,62 @@ public:
     /// Notes: if the secret is longer than the block size of its
     /// algorithm, the constructor will run it through the hash
     /// algorithm, and use the digest as the secret for this HMAC
-    /// operation
+    /// operation.
     ///
     /// If you want to safely delete objects created with this method,
     /// you can use the function deleteHMAC() as defined in
-    /// crypto_hmac.h
+    /// crypto_hmac.h.
     ///
-    /// \exception UnsupportedAlgorithmException if the given algorithm
-    ///            is unknown or not supported by the underlying library
-    /// \exception InvalidKeyLength if the given key secret_len is bad
-    /// \exception LibraryError if there was any unexpected exception
-    ///                         in the underlying library
+    /// @throw UnsupportedAlgorithmException if the given algorithm
+    ///        is unknown or not supported by the underlying library.
+    /// @throw InvalidKeyLength if the given key secret_len is bad.
+    /// @throw LibraryError if there was any unexpected exception
+    ///        in the underlying library.
     ///
-    /// \param secret The secret to sign with
-    /// \param secret_len The length of the secret
-    /// \param hash_algorithm The hash algorithm
+    /// @param secret The secret to sign with
+    /// @param secret_len The length of the secret
+    /// @param hash_algorithm The hash algorithm
+    ///
+    /// @return The new hash.
     HMAC* createHMAC(const void* secret, size_t secret_len,
                      const HashAlgorithm hash_algorithm);
 
-    /// \brief Get the global RNG
+    /// @brief Get the global RNG.
+    ///
+    /// @throw NotImplemented if the method was not implemented
+    ///        in a derived class.
+    /// @throw LibraryError if there was any unexpected exception
+    ///        in the underlying library.
     ///
-    /// \exception NotImplemented if the method was not implemented
-    ///                           in a derived class
-    /// \exception LibraryError if there was any unexpected exception
-    ///                         in the underlying library
+    /// @return The gobal RNG.
     virtual RNGPtr const& getRNG() const;
 
 private:
-    /// \brief Initialize the library
+    /// @brief Initialize the library.
     ///
     /// If the library has already been initialized (either by a call
     /// to initialize() or automatically in getCryptoLink()), this
     /// function does nothing.
     ///
-    /// \note A call to initialize() is not strictly necessary with
+    /// @note A call to initialize() is not strictly necessary with
     /// the current implementation.
     ///
-    /// \exception InitializationError if initialization fails
+    /// @throw InitializationError if initialization fails.
     ///
-    /// \param c the CryptoLink singleton instance which is being initialized.
+    /// @param c the CryptoLink singleton instance which is being initialized.
     void initialize(CryptoLink& c);
 
-    // To prevent people constructing their own, we make the constructor
-    // private too.
+    /// @note To prevent people constructing their own, we make the constructor
+    /// private too.
     CryptoLink() {
         initialize(*this);
     }
     ~CryptoLink();
 
-    /// \brief Smart pointer holding the implementation.
+    /// @brief Smart pointer holding the implementation.
     CryptoLinkImplPtr impl_;
 
-    /// \brief Smart pointer holding the RNG.
+    /// @brief Smart pointer holding the RNG.
     RNGPtr rng_;
 };
 
index b2e8e4fccc3bd2bea5337cc7c93680a4b7c261e9..935e502483bb2602071327ec673658dd2276a6f0 100644 (file)
@@ -5,10 +5,11 @@
 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 #include <config.h>
+
 #include <gtest/gtest.h>
 
-#include <log/logger_support.h>
 #include <util/unittests/run_all.h>
+#include <log/logger_support.h>
 
 int
 main(int argc, char* argv[]) {
index 2311b8f59757ccfb7d4491a0379afa4c64e7644e..79c82a4d02b8bbc9cbce3e52ef2254bdb3b20e9a 100644 (file)
@@ -43,6 +43,7 @@ libd2srv_unittests_LDADD += $(top_builddir)/src/lib/asiolink/libkea-asiolink.la
 libd2srv_unittests_LDADD += $(top_builddir)/src/lib/dns/libkea-dns++.la
 libd2srv_unittests_LDADD += $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la
 libd2srv_unittests_LDADD += $(top_builddir)/src/lib/log/libkea-log.la
+libd2srv_unittests_LDADD += $(top_builddir)/src/lib/util/unittests/libutil_unittests.la
 libd2srv_unittests_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
 libd2srv_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
 libd2srv_unittests_LDADD += $(LOG4CPLUS_LIBS) $(BOOST_LIBS) $(GTEST_LDADD)
index 768319e3fad5774d2de2817a6282fedd16545442..84baee26c7277b593bc255b4871deb9ea40d299b 100644 (file)
@@ -5,16 +5,15 @@
 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 #include <config.h>
-#include <log/logger_support.h>
 
 #include <gtest/gtest.h>
 
+#include <util/unittests/run_all.h>
+#include <log/logger_support.h>
+
 int
 main(int argc, char* argv[]) {
     ::testing::InitGoogleTest(&argc, argv);
     isc::log::initLogger();
-
-    int result = RUN_ALL_TESTS();
-
-    return (result);
+    return (isc::util::unittests::run_all());
 }
index f4cf4f0d3e5ed56dfc9f8c7827f775d5ad3af217..2301330953b1c140287b9506c6f9b511c33b7e8c 100644 (file)
@@ -35,6 +35,7 @@ libdatabase_unittests_LDADD += $(top_builddir)/src/lib/testutils/libkea-testutil
 libdatabase_unittests_LDADD += $(top_builddir)/src/lib/cc/libkea-cc.la
 libdatabase_unittests_LDADD += $(top_builddir)/src/lib/asiolink/libkea-asiolink.la
 libdatabase_unittests_LDADD += $(top_builddir)/src/lib/log/libkea-log.la
+libdatabase_unittests_LDADD += $(top_builddir)/src/lib/util/unittests/libutil_unittests.la
 libdatabase_unittests_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
 libdatabase_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
 libdatabase_unittests_LDADD += $(LOG4CPLUS_LIBS) $(BOOST_LIBS) $(GTEST_LDADD)
index 4e83d4bd6c4191c9cd53f97f823080f742d30fa5..1ccf6d1503d703091d5a09e840dc0c4600b136e4 100644 (file)
@@ -6,15 +6,14 @@
 
 #include <config.h>
 
-#include <log/logger_support.h>
 #include <gtest/gtest.h>
 
+#include <util/unittests/run_all.h>
+#include <log/logger_support.h>
+
 int
 main(int argc, char* argv[]) {
     ::testing::InitGoogleTest(&argc, argv);
     isc::log::initLogger();
-
-    int result = RUN_ALL_TESTS();
-
-    return (result);
+    return (isc::util::unittests::run_all());
 }
index 8bcc1af637757135805d26c77d16d6f903416752..bd60db0060b3e857fd82eb91a51d38986bca7298 100644 (file)
@@ -94,6 +94,7 @@ libdhcp___unittests_LDADD += $(top_builddir)/src/lib/asiolink/libkea-asiolink.la
 libdhcp___unittests_LDADD += $(top_builddir)/src/lib/dns/libkea-dns++.la
 libdhcp___unittests_LDADD += $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la
 libdhcp___unittests_LDADD += $(top_builddir)/src/lib/log/libkea-log.la
+libdhcp___unittests_LDADD += $(top_builddir)/src/lib/util/unittests/libutil_unittests.la
 libdhcp___unittests_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
 libdhcp___unittests_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
 libdhcp___unittests_LDADD += $(LOG4CPLUS_LIBS) $(CRYPTO_LIBS)
index b9c49f747af6784b5a575f9bad81e71466c55b23..6e81aed3f5f8e59b765769fea4db9f06e086b51b 100644 (file)
@@ -76,7 +76,6 @@ TEST(Option6PDExcludeTest, pack) {
     ASSERT_EQ(expected_vec.size(), buf.getLength());
 
     // Check that the generated wire format is correct.
-    const uint8_t* data = buf.getData();
     const std::vector<uint8_t>& vec = buf.getVector();
     ASSERT_TRUE(std::equal(vec.cbegin(), vec.cend(), expected_vec.cbegin()));
 }
index e1c0801f51989e06947699d411a3d8d15f1a03f2..c6d03a200dc9a7468e4a8def09bb903cd3a19756 100644 (file)
@@ -6,16 +6,14 @@
 
 #include <config.h>
 
-#include <log/logger_support.h>
-
 #include <gtest/gtest.h>
 
+#include <util/unittests/run_all.h>
+#include <log/logger_support.h>
+
 int
 main(int argc, char* argv[]) {
     ::testing::InitGoogleTest(&argc, argv);
     isc::log::initLogger();
-
-    int result = RUN_ALL_TESTS();
-
-    return (result);
+    return (isc::util::unittests::run_all());
 }
index 68ae6baabe0c00dc1932796ac78702f90a1ce0f7..abf16b9bfd7c4de81eecbb40b365658204229a06 100644 (file)
@@ -39,6 +39,7 @@ libdhcp_ddns_unittests_LDADD += $(top_builddir)/src/lib/asiolink/libkea-asiolink
 libdhcp_ddns_unittests_LDADD += $(top_builddir)/src/lib/dns/libkea-dns++.la
 libdhcp_ddns_unittests_LDADD += $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la
 libdhcp_ddns_unittests_LDADD += $(top_builddir)/src/lib/log/libkea-log.la
+libdhcp_ddns_unittests_LDADD += $(top_builddir)/src/lib/util/unittests/libutil_unittests.la
 libdhcp_ddns_unittests_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
 libdhcp_ddns_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
 libdhcp_ddns_unittests_LDADD += $(LOG4CPLUS_LIBS) $(CRYPTO_LIBS)
index e1c0801f51989e06947699d411a3d8d15f1a03f2..c6d03a200dc9a7468e4a8def09bb903cd3a19756 100644 (file)
@@ -6,16 +6,14 @@
 
 #include <config.h>
 
-#include <log/logger_support.h>
-
 #include <gtest/gtest.h>
 
+#include <util/unittests/run_all.h>
+#include <log/logger_support.h>
+
 int
 main(int argc, char* argv[]) {
     ::testing::InitGoogleTest(&argc, argv);
     isc::log::initLogger();
-
-    int result = RUN_ALL_TESTS();
-
-    return (result);
+    return (isc::util::unittests::run_all());
 }
index 20c670159f836375631bc4d52ddf63bbf86221ed..eb2cd2630f433fdfa20448f010f5838aeab6531a 100644 (file)
@@ -187,6 +187,7 @@ libdhcpsrv_unittests_LDADD += $(top_builddir)/src/lib/asiolink/libkea-asiolink.l
 libdhcpsrv_unittests_LDADD += $(top_builddir)/src/lib/dns/libkea-dns++.la
 libdhcpsrv_unittests_LDADD += $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la
 libdhcpsrv_unittests_LDADD += $(top_builddir)/src/lib/log/libkea-log.la
+libdhcpsrv_unittests_LDADD += $(top_builddir)/src/lib/util/unittests/libutil_unittests.la
 libdhcpsrv_unittests_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
 libdhcpsrv_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
 libdhcpsrv_unittests_LDADD += $(LOG4CPLUS_LIBS) $(CRYPTO_LIBS)
index 76b2ebf0bc3f3e809a7adf868d239eb42cb5f9a6..956fe8b13ee982e5aa671bd95cc37b922fabe10e 100644 (file)
@@ -5,16 +5,15 @@
 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 #include <config.h>
-#include <log/logger_support.h>
 
 #include <gtest/gtest.h>
 
+#include <util/unittests/run_all.h>
+#include <log/logger_support.h>
+
 int
 main(int argc, char* argv[]) {
     ::testing::InitGoogleTest(&argc, argv);
     isc::log::initLogger();
-
-    int result = RUN_ALL_TESTS();
-
-    return (result);
+    return (isc::util::unittests::run_all());
 }
index be5d0afa54fd8571e3e5a629701be7c22607fe2d..d5c57950d0d3cc6ad3b0fcc4b89d271ffb6aa9e5 100644 (file)
@@ -153,8 +153,8 @@ class Message {
 public:
     /// Constants to specify the operation mode of the \c Message.
     enum Mode {
-        PARSE = 0,              ///< Parse mode (handling an incoming message)
-        RENDER = 1              ///< Render mode (building an outgoing message)
+        PARSE = 0,              // Parse mode (handling an incoming message)
+        RENDER = 1              // Render mode (building an outgoing message)
     };
 
     /// \brief Constants for flag bit fields of a DNS message header.
@@ -200,13 +200,13 @@ public:
     /// between the complexity and advantage, but hopefully the cast notation
     /// is sufficiently ugly to prevent proliferation of the usage.
     enum HeaderFlag {
-        HEADERFLAG_QR = 0x8000, ///< Query (if cleared) or response (if set)
-        HEADERFLAG_AA = 0x0400, ///< Authoritative answer
-        HEADERFLAG_TC = 0x0200, ///< Truncation
-        HEADERFLAG_RD = 0x0100, ///< Recursion desired
-        HEADERFLAG_RA = 0x0080, ///< Recursion available
-        HEADERFLAG_AD = 0x0020, ///< Authentic %data (RFC4035)
-        HEADERFLAG_CD = 0x0010  ///< DNSSEC checking disabled (RFC4035)
+        HEADERFLAG_QR = 0x8000, // Query (if cleared) or response (if set)
+        HEADERFLAG_AA = 0x0400, // Authoritative answer
+        HEADERFLAG_TC = 0x0200, // Truncation
+        HEADERFLAG_RD = 0x0100, // Recursion desired
+        HEADERFLAG_RA = 0x0080, // Recursion available
+        HEADERFLAG_AD = 0x0020, // Authentic %data (RFC4035)
+        HEADERFLAG_CD = 0x0010  // DNSSEC checking disabled (RFC4035)
     };
 
     /// \brief Constants to specify sections of a DNS message.
@@ -240,10 +240,10 @@ public:
     /// <b>Future Extension:</b> We'll probably also define constants for
     /// the section names used in dynamic updates in future versions.
     enum Section {
-        SECTION_QUESTION = 0,   ///< %Question section
-        SECTION_ANSWER = 1,     ///< Answer section
-        SECTION_AUTHORITY = 2,  ///< Authority section
-        SECTION_ADDITIONAL = 3  ///< Additional section
+        SECTION_QUESTION = 0,   // Question section
+        SECTION_ANSWER = 1,     // Answer section
+        SECTION_AUTHORITY = 2,  // Authority section
+        SECTION_ADDITIONAL = 3  // Additional section
     };
 
     ///
@@ -594,8 +594,8 @@ public:
     /// These are values of a bitmask type.  Bitwise operations can be
     /// performed on these values to express compound options.
     enum ParseOptions {
-        PARSE_DEFAULT = 0,       ///< The default options
-        PRESERVE_ORDER = 1       ///< Preserve RR order and don't combine them
+        PARSE_DEFAULT = 0,      // The default options
+        PRESERVE_ORDER = 1      // Preserve RR order and don't combine them
     };
 
     /// \brief Parse the header section of the \c Message.
index 1a64f194ff7c86ca15ff2804edde849f035b7d21..37723e88f75411fb1572646c7d4a2c1a0c8dd5d4 100644 (file)
@@ -296,9 +296,9 @@ public:
     /// In addition, if resource allocation for the new name fails, a
     /// corresponding standard exception will be thrown.
     ///
-    /// \param buffer A buffer storing the wire format %data.
+    /// \param buff A buffer storing the wire format %data.
     /// \param downcase Whether to convert upper case alphabets to lower case.
-    explicit Name(isc::util::InputBuffer& buffer, bool downcase = false);
+    explicit Name(isc::util::InputBuffer& buff, bool downcase = false);
     ///
     /// We use the default copy constructor intentionally.
     //@}
@@ -420,8 +420,8 @@ public:
     /// <code>buffer.getCapacity() - buffer.getLength() >= Name::MAX_WIRE</code>
     /// then this method should not throw an exception.
     ///
-    /// \param buffer An output buffer to store the wire %data.
-    void toWire(isc::util::OutputBuffer& buffer) const;
+    /// \param buff An output buffer to store the wire %data.
+    void toWire(isc::util::OutputBuffer& buff) const;
     //@}
 
     ///
index efd6c3f167f0a16932531f47407f837cc0c5f9f9..088ca9fdfc6fc447bc4c128f3596b326621e7bc0 100644 (file)
@@ -106,8 +106,8 @@ public:
     /// It may throw an exception if the construction of these component
     /// classes fails.
     ///
-    /// \param buffer A buffer storing the wire format data.
-    Question(isc::util::InputBuffer& buffer);
+    /// \param buff A buffer storing the wire format data.
+    Question(isc::util::InputBuffer& buff);
 
     /// \brief Constructor from fixed parameters of the \c Question.
     ///
index af294f0670e085825d5da850ae545962d0559181..47d7c77923ed87331876e9f1130021f39590a82e 100644 (file)
@@ -163,8 +163,8 @@ public:
     /// conversion is specific to each derived concrete class and
     /// should be explicitly defined in the derived class.
     ///
-    /// \param buffer An output buffer to store the wire data.
-    virtual void toWire(isc::util::OutputBuffer& buffer) const = 0;
+    /// \param buff An output buffer to store the wire data.
+    virtual void toWire(isc::util::OutputBuffer& buff) const = 0;
 
     /// \brief Render the \c Rdata in the wire format into a
     /// \c MessageRenderer object.
@@ -282,10 +282,10 @@ public:
     /// contain \c rdata_len bytes of unread data, an exception of
     /// class \c isc::OutOfRange will be thrown.
     ///
-    /// \param buffer A reference to an \c InputBuffer object storing the
+    /// \param buff A reference to an \c InputBuffer object storing the
     /// \c Rdata to parse.
     /// \param rdata_len The length in buffer of the \c Rdata.  In bytes.
-    Generic(isc::util::InputBuffer& buffer, size_t rdata_len);
+    Generic(isc::util::InputBuffer& buff, size_t rdata_len);
 
     /// \brief Constructor from master lexer.
     ///
@@ -337,8 +337,8 @@ public:
     /// necessary memory space fails, a corresponding standard exception will
     /// be thrown.
     ///
-    /// \param buffer An output buffer to store the wire data.
-    virtual void toWire(isc::util::OutputBuffer& buffer) const;
+    /// \param buff An output buffer to store the wire data.
+    virtual void toWire(isc::util::OutputBuffer& buff) const;
 
     /// \brief Render the \c generic::Generic in the wire format into a
     /// \c MessageRenderer object.
@@ -465,13 +465,13 @@ RdataPtr createRdata(const RRType& rrtype, const RRClass& rrclass,
 ///
 /// \param rrtype An \c RRType object specifying the type/class pair.
 /// \param rrclass An \c RRClass object specifying the type/class pair.
-/// \param buffer A reference to an \c InputBuffer object storing the
+/// \param buff A reference to an \c InputBuffer object storing the
 /// \c Rdata to parse.
 /// \param len The length in buffer of the \c Rdata.  In bytes.
 /// \return An \c RdataPtr object pointing to the created \c Rdata
 /// object.
 RdataPtr createRdata(const RRType& rrtype, const RRClass& rrclass,
-                     isc::util::InputBuffer& buffer, size_t len);
+                     isc::util::InputBuffer& buff, size_t len);
 
 /// \brief Create RDATA of a given pair of RR type and class, copying
 /// of another RDATA of same kind.
index 01d9059fc2147d2a45e302e08cddc46d991375ed..3ac76154956fb24fc12f4504b533d44e3a45fc96 100644 (file)
@@ -90,11 +90,11 @@ public:
     /// of specific class corresponding to the specific derived class of
     /// \c AbstractRdataFactory.
     ///
-    /// \param buffer A reference to an \c InputBuffer object storing the
+    /// \param buff A reference to an \c InputBuffer object storing the
     /// \c Rdata to parse.
     /// \param rdata_len The length in buffer of the \c Rdata.  In bytes.
     /// \return An \c RdataPtr object pointing to the created \c Rdata object.
-    virtual RdataPtr create(isc::util::InputBuffer& buffer,
+    virtual RdataPtr create(isc::util::InputBuffer& buff,
                             size_t rdata_len) const = 0;
 
     /// \brief Create RDATA from another \c Rdata object of the same type.
@@ -483,13 +483,13 @@ public:
     ///
     /// \param rrtype An \c RRType object specifying the type/class pair.
     /// \param rrclass An \c RRClass object specifying the type/class pair.
-    /// \param buffer A reference to an \c InputBuffer object storing the
+    /// \param buff A reference to an \c InputBuffer object storing the
     /// \c Rdata to parse.
     /// \param len The length in buffer of the \c Rdata.  In bytes.
     /// \return An \c rdata::RdataPtr object pointing to the created \c Rdata
     /// object.
     rdata::RdataPtr createRdata(const RRType& rrtype, const RRClass& rrclass,
-                                isc::util::InputBuffer& buffer, size_t len);
+                                isc::util::InputBuffer& buff, size_t len);
     /// \brief Create RDATA of a given pair of RR type and class, copying
     /// of another RDATA of same kind.
     ///
index 8f6b03ebd5467afc92e17f06d5b9ef2fc2706ac3..fb723c1a435e24a16191853c2ba6fc2ec455b017 100644 (file)
@@ -89,8 +89,8 @@ public:
     /// If the given data does not large enough to contain a 16-bit integer,
     /// an exception of class \c IncompleteRRTTL will be thrown.
     ///
-    /// \param buffer A buffer storing the wire format data.
-    explicit RRTTL(isc::util::InputBuffer& buffer);
+    /// \param buff A buffer storing the wire format data.
+    explicit RRTTL(isc::util::InputBuffer& buff);
 
     /// A separate factory of RRTTL from text.
     ///
@@ -157,8 +157,8 @@ public:
     /// If resource allocation in rendering process fails, a corresponding
     /// standard exception will be thrown.
     ///
-    /// \param buffer An output buffer to store the wire data.
-    void toWire(isc::util::OutputBuffer& buffer) const;
+    /// \param buff An output buffer to store the wire data.
+    void toWire(isc::util::OutputBuffer& buff) const;
     //@}
 
     ///
index 92a12bd146bc2f5ddf2ae1c26cdf56b8873fa38e..b7f76945bc6bd53e05fa89b6d9bdf4ee62cc9213 100644 (file)
@@ -26,35 +26,6 @@ using namespace isc::cryptolink;
 
 namespace isc {
 namespace dns {
-namespace {
-    HashAlgorithm
-    convertAlgorithmName(const isc::dns::Name& name) {
-        if (name == TSIGKey::HMACMD5_NAME()) {
-            return (isc::cryptolink::MD5);
-        }
-        if (name == TSIGKey::HMACMD5_SHORT_NAME()) {
-            return (isc::cryptolink::MD5);
-        }
-        if (name == TSIGKey::HMACSHA1_NAME()) {
-            return (isc::cryptolink::SHA1);
-        }
-        if (name == TSIGKey::HMACSHA256_NAME()) {
-            return (isc::cryptolink::SHA256);
-        }
-        if (name == TSIGKey::HMACSHA224_NAME()) {
-            return (isc::cryptolink::SHA224);
-        }
-        if (name == TSIGKey::HMACSHA384_NAME()) {
-            return (isc::cryptolink::SHA384);
-        }
-        if (name == TSIGKey::HMACSHA512_NAME()) {
-            return (isc::cryptolink::SHA512);
-        }
-
-        return (isc::cryptolink::UNKNOWN_HASH);
-    }
-}
-
 struct
 TSIGKey::TSIGKeyImpl {
     TSIGKeyImpl(const Name& key_name, const Name& algorithm_name,
@@ -92,6 +63,35 @@ TSIGKey::TSIGKeyImpl {
     const vector<uint8_t> secret_;
 };
 
+namespace {
+    HashAlgorithm
+    convertAlgorithmName(const isc::dns::Name& name) {
+        if (name == TSIGKey::HMACMD5_NAME()) {
+            return (isc::cryptolink::MD5);
+        }
+        if (name == TSIGKey::HMACMD5_SHORT_NAME()) {
+            return (isc::cryptolink::MD5);
+        }
+        if (name == TSIGKey::HMACSHA1_NAME()) {
+            return (isc::cryptolink::SHA1);
+        }
+        if (name == TSIGKey::HMACSHA224_NAME()) {
+            return (isc::cryptolink::SHA224);
+        }
+        if (name == TSIGKey::HMACSHA256_NAME()) {
+            return (isc::cryptolink::SHA256);
+        }
+        if (name == TSIGKey::HMACSHA384_NAME()) {
+            return (isc::cryptolink::SHA384);
+        }
+        if (name == TSIGKey::HMACSHA512_NAME()) {
+            return (isc::cryptolink::SHA512);
+        }
+
+        return (isc::cryptolink::UNKNOWN_HASH);
+    }
+}
+
 TSIGKey::TSIGKey(const Name& key_name, const Name& algorithm_name,
                  const void* secret, size_t secret_len,
                  size_t digestbits /*= 0*/) : impl_(0) {
@@ -248,54 +248,6 @@ TSIGKey::toText() const {
     }
 }
 
-const
-Name& TSIGKey::HMACMD5_NAME() {
-    static Name alg_name("hmac-md5.sig-alg.reg.int");
-    return (alg_name);
-}
-
-const
-Name& TSIGKey::HMACMD5_SHORT_NAME() {
-    static Name alg_name("hmac-md5");
-    return (alg_name);
-}
-
-const
-Name& TSIGKey::HMACSHA1_NAME() {
-    static Name alg_name("hmac-sha1");
-    return (alg_name);
-}
-
-const
-Name& TSIGKey::HMACSHA256_NAME() {
-    static Name alg_name("hmac-sha256");
-    return (alg_name);
-}
-
-const
-Name& TSIGKey::HMACSHA224_NAME() {
-    static Name alg_name("hmac-sha224");
-    return (alg_name);
-}
-
-const
-Name& TSIGKey::HMACSHA384_NAME() {
-    static Name alg_name("hmac-sha384");
-    return (alg_name);
-}
-
-const
-Name& TSIGKey::HMACSHA512_NAME() {
-    static Name alg_name("hmac-sha512");
-    return (alg_name);
-}
-
-const
-Name& TSIGKey::GSSTSIG_NAME() {
-    static Name alg_name("gss-tsig");
-    return (alg_name);
-}
-
 struct TSIGKeyRing::TSIGKeyRingImpl {
     typedef map<Name, TSIGKey> TSIGKeyMap;
     typedef pair<Name, TSIGKey> NameAndKey;
@@ -315,9 +267,7 @@ TSIGKeyRing::size() const {
 
 TSIGKeyRing::Result
 TSIGKeyRing::add(const TSIGKey& key) {
-    if (impl_->keys.insert(
-                TSIGKeyRingImpl::NameAndKey(key.getKeyName(), key)).second
-        == true) {
+    if (impl_->keys.insert(TSIGKeyRingImpl::NameAndKey(key.getKeyName(), key)).second) {
         return (SUCCESS);
     } else {
         return (EXIST);
@@ -350,5 +300,53 @@ TSIGKeyRing::find(const Name& key_name, const Name& algorithm_name) const {
     return (FindResult(SUCCESS, &((*found).second)));
 }
 
+const
+Name& TSIGKey::HMACMD5_NAME() {
+    static Name alg_name("hmac-md5.sig-alg.reg.int");
+    return (alg_name);
+}
+
+const
+Name& TSIGKey::HMACMD5_SHORT_NAME() {
+    static Name alg_name("hmac-md5");
+    return (alg_name);
+}
+
+const
+Name& TSIGKey::HMACSHA1_NAME() {
+    static Name alg_name("hmac-sha1");
+    return (alg_name);
+}
+
+const
+Name& TSIGKey::HMACSHA224_NAME() {
+    static Name alg_name("hmac-sha224");
+    return (alg_name);
+}
+
+const
+Name& TSIGKey::HMACSHA256_NAME() {
+    static Name alg_name("hmac-sha256");
+    return (alg_name);
+}
+
+const
+Name& TSIGKey::HMACSHA384_NAME() {
+    static Name alg_name("hmac-sha384");
+    return (alg_name);
+}
+
+const
+Name& TSIGKey::HMACSHA512_NAME() {
+    static Name alg_name("hmac-sha512");
+    return (alg_name);
+}
+
+const
+Name& TSIGKey::GSSTSIG_NAME() {
+    static Name alg_name("gss-tsig");
+    return (alg_name);
+}
+
 } // namespace dns
 } // namespace isc
index 93810741afa0ae53b0d58378b6a4200f9c52280d..6d6e7a3218fbe1232fd6f06d61dd21a4f9d4106d 100644 (file)
@@ -14,7 +14,7 @@ namespace dns {
 
 class Name;
 
-/// \brief TSIG key.
+/// @brief TSIG key.
 ///
 /// This class holds a TSIG key along with some related attributes as
 /// defined in RFC2845.
@@ -38,7 +38,7 @@ class Name;
 /// In the TSIG protocol, hash algorithms are represented in the form of
 /// domain name.
 /// Our interfaces provide direct translation of this concept; for example,
-/// the constructor from parameters take a \c Name object to specify the
+/// the constructor from parameters take a @class Name object to specify the
 /// algorithm.
 /// On one hand, this may be counter intuitive.
 /// An API user would rather specify "hmac-md5" instead of
@@ -56,25 +56,25 @@ class Name;
 class TSIGKey {
 public:
     ///
-    /// \name Constructors, Assignment Operator and Destructor.
+    /// @brief Constructors, Assignment Operator and Destructor.
     ///
     //@{
-    /// \brief Constructor from key parameters
+    /// @brief Constructor from key parameters.
     ///
-    /// \c algorithm_name should generally be a known algorithm to this
+    /// The algorithm_name should generally be a known algorithm to this
     /// implementation, which are defined via the
     /// <code>static const</code> member functions.
     ///
     /// Other names are still accepted as long as the secret is empty
-    /// (\c secret is null and \c secret_len is 0), however; in some cases
+    /// (secret is null and secret_len is 0), however; in some cases
     /// we might want to treat just the pair of key name and algorithm name
     /// opaquely, e.g., when generating a response TSIG with a BADKEY error
     /// because the algorithm is unknown as specified in Section 3.2 of
     /// RFC2845 (in which case the algorithm name would be copied from the
     /// request to the response, and for that purpose it would be convenient
-    /// if a \c TSIGKey object can hold a name for an "unknown" algorithm).
+    /// if a TSIGKey object can hold a name for an "unknown" algorithm).
     ///
-    /// \note RFC2845 does not specify which algorithm name should be used
+    /// @note RFC2845 does not specify which algorithm name should be used
     /// in such a BADKEY response.  The behavior of using the same algorithm
     /// is derived from the BIND 9 implementation.
     ///
@@ -84,13 +84,13 @@ public:
     /// accidental creation of such a dangerous key, e.g., due to misspelling
     /// in a configuration file).
     /// If the given algorithm name is unknown and non empty secret is
-    /// specified, an exception of type \c InvalidParameter will be thrown.
+    /// specified, an exception of type InvalidParameter will be thrown.
     ///
-    /// \c secret and \c secret_len must be consistent in that the latter
+    /// secret and secret_len must be consistent in that the latter
     /// is 0 if and only if the former is null;
-    /// otherwise an exception of type \c InvalidParameter will be thrown.
+    /// otherwise an exception of type InvalidParameter will be thrown.
     ///
-    /// \c digestbits is the truncated length in bits or 0 which means no
+    /// digestbits is the truncated length in bits or 0 which means no
     /// truncation and is the default. Constraints for non-zero value
     /// are in RFC 4635 section 3.1: minimum 80 or the half of the
     /// full (i.e., not truncated) length, integral number of octets
@@ -99,19 +99,19 @@ public:
     /// This constructor internally involves resource allocation, and if
     /// it fails, a corresponding standard exception will be thrown.
     ///
-    /// \param key_name The name of the key as a domain name.
-    /// \param algorithm_name The hash algorithm used for this key in the
+    /// @param key_name The name of the key as a domain name.
+    /// @param algorithm_name The hash algorithm used for this key in the
     /// form of domain name.  For example, it can be
-    /// \c TSIGKey::HMACSHA256_NAME() for HMAC-SHA256.
-    /// \param secret Point to a binary sequence of the shared secret to be
+    /// TSIGKey::HMACSHA256_NAME() for HMAC-SHA256.
+    /// @param secret Point to a binary sequence of the shared secret to be
     /// used for this key, or null if the secret is empty.
-    /// \param secret_len The size of the binary %data (\c secret) in bytes.
-    /// \param digestbits The number of bits to include in the digest
-    /// (0 means to include all)
+    /// @param secret_len The size of the binary %data (secret) in bytes.
+    /// @param digestbits The number of bits to include in the digest
+    /// (0 means to include all).
     TSIGKey(const Name& key_name, const Name& algorithm_name,
             const void* secret, size_t secret_len, size_t digestbits = 0);
 
-    /// \brief Constructor from an input string
+    /// @brief Constructor from an input string
     ///
     /// The string must be of the form:
     /// name:secret[:algorithm][:digestbits]
@@ -129,20 +129,20 @@ public:
     /// use this constructor to create keys with a ':' character in
     /// their name.
     ///
-    /// \exception InvalidParameter exception if the input string is
+    /// @throw InvalidParameter exception if the input string is
     /// invalid.
     ///
-    /// \param str The string to make a TSIGKey from
+    /// @param str The string to make a TSIGKey from
     explicit TSIGKey(const std::string& str);
 
-    /// \brief The copy constructor.
+    /// @brief The copy constructor.
     ///
     /// It internally allocates a resource, and if it fails a corresponding
     /// standard exception will be thrown.
     /// This constructor never throws an exception otherwise.
     TSIGKey(const TSIGKey& source);
 
-    /// \brief Assignment operator.
+    /// @brief Assignment operator.
     ///
     /// It internally allocates a resource, and if it fails a corresponding
     /// standard exception will be thrown.
@@ -153,70 +153,69 @@ public:
     /// intact.
     TSIGKey& operator=(const TSIGKey& source);
 
-    /// The destructor.
+    /// @brief The destructor.
     virtual ~TSIGKey();
     //@}
 
     ///
-    /// \name Getter Methods
+    /// @brief Getter Methods
     ///
     /// These methods never throw an exception.
     //@{
-    /// Return the key name.
+    /// @brief Return the key name.
     const Name& getKeyName() const;
 
-    /// Return the algorithm name.
+    /// @brief Return the algorithm name.
     const Name& getAlgorithmName() const;
 
-    /// Return the hash algorithm name in the form of cryptolink::HashAlgorithm
+    /// @brief Return the hash algorithm name in the form of cryptolink::HashAlgorithm
     isc::cryptolink::HashAlgorithm getAlgorithm() const;
 
-    /// Return the minimum truncated length.
+    /// @brief Return the minimum truncated length.
     size_t getDigestbits() const;
 
-    /// Return the length of the TSIG secret in bytes.
+    /// @brief Return the length of the TSIG secret in bytes.
     size_t getSecretLength() const;
 
-    /// Return the value of the TSIG secret.
+    /// @brief Return the value of the TSIG secret.
     ///
     /// If it returns a non null pointer, the memory region beginning at the
     /// address returned by this method is valid up to the bytes specified
-    /// by the return value of \c getSecretLength().
+    /// by the return value of getSecretLength().
     ///
-    /// The memory region is only valid while the corresponding \c TSIGKey
-    /// object is valid.  The caller must hold the \c TSIGKey object while
+    /// The memory region is only valid while the corresponding TSIGKey
+    /// object is valid.  The caller must hold the TSIGKey object while
     /// it needs to refer to the region or it must make a local copy of the
     /// region.
     const void* getSecret() const;
     //@}
 
-    /// \brief Converts the TSIGKey to a string value
+    /// @brief Converts the TSIGKey to a string value
     ///
     /// The resulting string will be of the form
-    /// name:secret:algorithm[:digestbits]
+    /// name:secret:algorithm[:digestbits].
     /// Where "name" is a domain name for the key, "secret" is a
     /// base64 representation of the key secret, and "algorithm" is
     /// an algorithm identifier as specified in RFC 4635.
     /// When not zero, digestbits is appended.
     ///
-    /// \return The string representation of the given TSIGKey.
+    /// @return The string representation of the given TSIGKey.
     std::string toText() const;
 
-    ///
-    /// \name Well known algorithm names as defined in RFC2845 and RFC4635.
+    /// @brief Well known algorithm names as defined in RFC2845 and RFC4635.
     ///
     /// Note: we begin with the "mandatory" algorithms defined in RFC4635
     /// as a minimal initial set.
     /// We'll add others as we see the need for them.
     //@{
-    static const Name& HMACMD5_NAME();    ///< HMAC-MD5 (RFC2845)
+    static const Name& HMACMD5_NAME();    // HMAC-MD5 (RFC2845)
     static const Name& HMACMD5_SHORT_NAME();
-    static const Name& HMACSHA1_NAME();   ///< HMAC-SHA1 (RFC4635)
-    static const Name& HMACSHA256_NAME(); ///< HMAC-SHA256 (RFC4635)
-    static const Name& HMACSHA224_NAME(); ///< HMAC-SHA256 (RFC4635)
-    static const Name& HMACSHA384_NAME(); ///< HMAC-SHA256 (RFC4635)
-    static const Name& HMACSHA512_NAME(); ///< HMAC-SHA256 (RFC4635)
-    static const Name& GSSTSIG_NAME();    ///< GSS-TSIG (RFC3645)
+    static const Name& HMACSHA1_NAME();   // HMAC-SHA1 (RFC4635)
+    static const Name& HMACSHA256_NAME(); // HMAC-SHA256 (RFC4635)
+    static const Name& HMACSHA224_NAME(); // HMAC-SHA256 (RFC4635)
+    static const Name& HMACSHA384_NAME(); // HMAC-SHA256 (RFC4635)
+    static const Name& HMACSHA512_NAME(); // HMAC-SHA256 (RFC4635)
+    static const Name& GSSTSIG_NAME();    // GSS-TSIG (RFC3645)
     //@}
 
 private:
@@ -224,9 +223,9 @@ private:
     boost::shared_ptr<TSIGKeyImpl> impl_;
 };
 
-/// \brief A simple repository of a set of \c TSIGKey objects.
+/// @brief A simple repository of a set of TSIGKey objects.
 ///
-/// This is a "key ring" to maintain TSIG keys (\c TSIGKey objects) and
+/// This is a "key ring" to maintain TSIG keys (TSIGKey objects) and
 /// provides trivial operations such as add, remove, and find.
 ///
 /// The keys are identified by their key names.
@@ -245,18 +244,18 @@ private:
 /// we may have to revisit the design.
 class TSIGKeyRing {
 public:
-    /// Result codes of various public methods of \c TSIGKeyRing
+    /// Result codes of various public methods of TSIGKeyRing
     enum Result {
-        SUCCESS = 0,    ///< The operation is successful.
-        EXIST = 1,      ///< A key is already stored in \c TSIGKeyRing.
-        NOTFOUND = 2    ///< The specified key is not found in \c TSIGKeyRing.
+        SUCCESS = 0,    // The operation is successful.
+        EXIST = 1,      // A key is already stored in TSIGKeyRing.
+        NOTFOUND = 2    // The specified key is not found in TSIGKeyRing.
     };
 
-    /// \brief A helper structure to represent the search result of
+    /// @brief A helper structure to represent the search result of
     /// <code>TSIGKeyRing::find()</code>.
     ///
     /// This is a straightforward pair of the result code and a pointer
-    /// to the found key to represent the result of \c find().
+    /// to the found key to represent the result of find().
     /// We use this in order to avoid overloading the return value for both
     /// the result code ("success" or "not found") and the found object,
     /// i.e., avoid using null to mean "not found", etc.
@@ -265,7 +264,7 @@ public:
     /// convenience we allow the applications to refer to the members
     /// directly.
     ///
-    /// See the description of \c find() for the semantics of the member
+    /// See the description of find() for the semantics of the member
     /// variables.
     struct FindResult {
         FindResult(Result param_code, const TSIGKey* param_key) :
@@ -276,10 +275,9 @@ public:
     };
 
     ///
-    /// \name Constructors and Destructor.
+    /// @brief Constructors and Destructor.
     ///
-    /// \b Note:
-    /// The copy constructor and the assignment operator are
+    /// @note The copy constructor and the assignment operator are
     /// intentionally defined as private, making this class non copyable.
     /// There is no technical reason why this class cannot be copied,
     /// but since the key ring can potentially have a large number of keys,
@@ -293,21 +291,21 @@ private:
     TSIGKeyRing(const TSIGKeyRing& source);
     TSIGKeyRing& operator=(const TSIGKeyRing& source);
 public:
-    /// \brief The default constructor.
+    /// @brief The default constructor.
     ///
     /// This constructor never throws an exception.
     TSIGKeyRing();
 
-    /// The destructor.
+    /// @brief The destructor.
     ~TSIGKeyRing();
     //@}
 
-    /// Return the number of keys stored in the \c TSIGKeyRing.
+    /// @brief Return the number of keys stored in the TSIGKeyRing.
     ///
     /// This method never throws an exception.
     unsigned int size() const;
 
-    /// Add a \c TSIGKey to the \c TSIGKeyRing.
+    /// @brief Add a TSIGKey to the TSIGKeyRing.
     ///
     /// This method will create a local copy of the given key, so the caller
     /// does not have to keep owning it.
@@ -316,65 +314,64 @@ public:
     /// exception will be thrown.
     /// This method never throws an exception otherwise.
     ///
-    /// \param key A \c TSIGKey to be added.
-    /// \return \c SUCCESS If the key is successfully added to the key ring.
-    /// \return \c EXIST The key ring already stores a key whose name is
-    /// identical to that of \c key.
+    /// @param key A TSIGKey to be added.
+    /// @return SUCCESS if the key is successfully added to the key ring or
+    /// EXIST if the key ring already stores a key whose name is identical to
+    /// that of key.
     Result add(const TSIGKey& key);
 
-    /// Remove a \c TSIGKey for the given name from the \c TSIGKeyRing.
+    /// Remove a TSIGKey for the given name from the TSIGKeyRing.
     ///
     /// This method never throws an exception.
     ///
-    /// \param key_name The name of the key to be removed.
-    /// \return \c SUCCESS If the key is successfully removed from the key
-    /// ring.
-    /// \return \c NOTFOUND The key ring does not store the key that matches
-    /// \c key_name.
+    /// @param key_name The name of the key to be removed.
+    /// @return SUCCESS if the key is successfully removed from the key
+    /// ring or NOTFOUND  if the key ring does not store the key that matches
+    /// key_name.
     Result remove(const Name& key_name);
 
-    /// Find a \c TSIGKey for the given name in the \c TSIGKeyRing.
+    /// Find a TSIGKey for the given name in the TSIGKeyRing.
     ///
-    /// It searches the internal storage for a \c TSIGKey whose name is
-    /// \c key_name.
-    /// It returns the result in the form of a \c FindResult
+    /// It searches the internal storage for a TSIGKey whose name is
+    /// key_name.
+    /// It returns the result in the form of a FindResult
     /// object as follows:
-    /// - \c code: \c SUCCESS if a key is found; otherwise \c NOTFOUND.
-    /// - \c key: A pointer to the found \c TSIGKey object if one is found;
+    /// - code: SUCCESS if a key is found; otherwise NOTFOUND.
+    /// - key: A pointer to the found TSIGKey object if one is found;
     /// otherwise null.
     ///
-    /// The pointer returned in the \c FindResult object is only valid until
+    /// The pointer returned in the FindResult object is only valid until
     /// the corresponding key is removed from the key ring.
     /// The caller must ensure that the key is held in the key ring while
     /// it needs to refer to it, or it must make a local copy of the key.
     ///
     /// This method never throws an exception.
     ///
-    /// \param key_name The name of the key to be found.
-    /// \return A \c FindResult object enclosing the search result (see above).
+    /// @param key_name The name of the key to be found.
+    /// @return A FindResult object enclosing the search result (see above).
     FindResult find(const Name& key_name) const;
 
-    /// Find a \c TSIGKey for the given name in the \c TSIGKeyRing.
+    /// Find a TSIGKey for the given name in the TSIGKeyRing.
     ///
-    /// It searches the internal storage for a \c TSIGKey whose name is
-    /// \c key_name and that uses the hash algorithm identified by
-    /// \c algorithm_name.
-    /// It returns the result in the form of a \c FindResult
+    /// It searches the internal storage for a TSIGKey whose name is
+    /// key_name and that uses the hash algorithm identified by
+    /// algorithm_name.
+    /// It returns the result in the form of a FindResult
     /// object as follows:
-    /// - \c code: \c SUCCESS if a key is found; otherwise \c NOTFOUND.
-    /// - \c key: A pointer to the found \c TSIGKey object if one is found;
+    /// - code: SUCCESS if a key is found; otherwise NOTFOUND.
+    /// - key: A pointer to the found TSIGKey object if one is found;
     /// otherwise null.
     ///
-    /// The pointer returned in the \c FindResult object is only valid until
+    /// The pointer returned in the FindResult object is only valid until
     /// the corresponding key is removed from the key ring.
     /// The caller must ensure that the key is held in the key ring while
     /// it needs to refer to it, or it must make a local copy of the key.
     ///
     /// This method never throws an exception.
     ///
-    /// \param key_name The name of the key to be found.
-    /// \param algorithm_name The name of the algorithm of the found key.
-    /// \return A \c FindResult object enclosing the search result (see above).
+    /// @param key_name The name of the key to be found.
+    /// @param algorithm_name The name of the algorithm of the found key.
+    /// @return A FindResult object enclosing the search result (see above).
     FindResult find(const Name& key_name, const Name& algorithm_name) const;
 
 private:
index 13ba09715b1a6ec1c80230bad3e0f53d40d561c6..b053b54726d444966213f4937b1f3f0a4a27b6c8 100644 (file)
@@ -37,6 +37,7 @@ libeval_unittests_LDADD += $(top_builddir)/src/lib/asiolink/libkea-asiolink.la
 libeval_unittests_LDADD += $(top_builddir)/src/lib/dns/libkea-dns++.la
 libeval_unittests_LDADD += $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la
 libeval_unittests_LDADD += $(top_builddir)/src/lib/log/libkea-log.la
+libeval_unittests_LDADD += $(top_builddir)/src/lib/util/unittests/libutil_unittests.la
 libeval_unittests_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
 libeval_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
 libeval_unittests_LDADD += $(CRYPTO_LIBS) $(LOG4CPLUS_LIBS)
index 08f04d1ba98aed9d4db326e10690fed54753239b..561038b997ace3d25474c57b3aaf2fb3d973ec96 100644 (file)
@@ -6,16 +6,14 @@
 
 #include <config.h>
 
-#include <log/logger_support.h>
-
 #include <gtest/gtest.h>
 
+#include <util/unittests/run_all.h>
+#include <log/logger_support.h>
+
 int
 main(int argc, char* argv[]) {
     ::testing::InitGoogleTest(&argc, argv);
     isc::log::initLogger();
-
-    int result = RUN_ALL_TESTS();
-
-    return (result);
+    return (isc::util::unittests::run_all());
 }
index 0f891599887a91de66aa2aff94b01510f5c0929d..0cd982a57352c0e5b61ade9a7c4b877bc5dbf72a 100644 (file)
@@ -258,7 +258,3 @@ public:
 
 }
 #endif // EXCEPTIONS_H
-
-// Local Variables:
-// mode: c++
-// End:
index cd6fc2bf312394ef7e40b46ade7953fed46d0b43..cf3f2040f2133cdd714ee52673f0f7dbfb069833 100644 (file)
@@ -6,11 +6,11 @@
 
 #include <config.h>
 
-#include <log/logger_support.h>
-#include <util/unittests/run_all.h>
-
 #include <gtest/gtest.h>
 
+#include <util/unittests/run_all.h>
+#include <log/logger_support.h>
+
 int
 main(int argc, char* argv[]) {
     ::testing::InitGoogleTest(&argc, argv);
index 5b2b2a0e7460d9d0f55616d0e76218d2dbf91adc..c8005e25a92c3d13ec030fd7d6f81c90e13cfea7 100644 (file)
@@ -67,6 +67,7 @@ libhttp_unittests_LDADD += $(top_builddir)/src/lib/cc/libkea-cc.la
 libhttp_unittests_LDADD += $(top_builddir)/src/lib/asiolink/testutils/libasiolinktest.la
 libhttp_unittests_LDADD += $(top_builddir)/src/lib/asiolink/libkea-asiolink.la
 libhttp_unittests_LDADD += $(top_builddir)/src/lib/log/libkea-log.la
+libhttp_unittests_LDADD += $(top_builddir)/src/lib/util/unittests/libutil_unittests.la
 libhttp_unittests_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
 libhttp_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
 libhttp_unittests_LDADD += $(LOG4CPLUS_LIBS)
index 17255dcc2280e16f30f326ec51870a0a0ff0d1d3..63da3739f8d1754bee3d65a9c579a26985e069a4 100644 (file)
@@ -6,16 +6,14 @@
 
 #include <config.h>
 
-#include <log/logger_support.h>
-#include <http/http_log.h>
 #include <gtest/gtest.h>
 
+#include <util/unittests/run_all.h>
+#include <log/logger_support.h>
+
 int
 main(int argc, char* argv[]) {
     ::testing::InitGoogleTest(&argc, argv);
     isc::log::initLogger();
-
-    int result = RUN_ALL_TESTS();
-
-    return (result);
+    return (isc::util::unittests::run_all());
 }
index 4ad294625b6787e12075cd073c60b5855c06d620..78a7ffa7431384150f54de284274e95d4bcd37f3 100644 (file)
@@ -37,8 +37,7 @@ EXTRA_DIST  = logging.dox
 EXTRA_DIST += logimpl_messages.mes
 EXTRA_DIST += log_messages.mes
 
-# Note: the ordering matters: -Wno-... must follow -Wextra (defined in
-# KEA_CXXFLAGS)
+# Note: the ordering matters: -Wno-... must follow -Wextra (defined in KEA_CXXFLAGS)
 libkea_log_la_CXXFLAGS = $(AM_CXXFLAGS)
 if USE_GXX
 libkea_log_la_CXXFLAGS += -Wno-unused-parameter -Wno-deprecated-declarations
index 81f408742bbe74a97ee3df8e2970337c53cb75ae..981f7385bb2d4a2486c78eedd16b1beaf73bec82 100644 (file)
@@ -33,6 +33,7 @@
 
 using namespace std;
 using namespace isc::log;
+using namespace isc::util;
 using namespace isc::util::file;
 
 /// \file log/compiler/message.cc
@@ -98,7 +99,7 @@ sentinel(Path& file) {
     string name = file.stem();
     string ext = file.extension();
     string sentinel_text = name + "_" + ext.substr(1);
-    isc::util::str::uppercase(sentinel_text);
+    str::uppercase(sentinel_text);
     return (sentinel_text);
 }
 
@@ -175,7 +176,7 @@ splitNamespace(string ns) {
 
     // ... and return the vector of namespace components split on the single
     // colon.
-    return (isc::util::str::tokens(ns, ":"));
+    return (str::tokens(ns, ":"));
 }
 
 /// \brief Write Opening Namespace(s)
index 68858050310871b7e2957e7a62cc4ea7e699ee2a..11da719a08d7db5a4e27473e37371131df5fb367 100644 (file)
@@ -18,6 +18,7 @@
 #include <log/message_reader.h>
 #include <util/str.h>
 
+using namespace isc::util;
 using namespace std;
 
 namespace {
@@ -71,7 +72,7 @@ void
 MessageReader::processLine(const string& line, MessageReader::Mode mode) {
 
     // Get rid of leading and trailing spaces
-    string text = isc::util::str::trim(line);
+    string text(str::trim(line));
 
     if (text.empty()) {
         ;                           // Ignore blank lines
@@ -96,14 +97,14 @@ MessageReader::parseDirective(const std::string& text) {
 
 
     // Break into tokens
-    vector<string> tokens = isc::util::str::tokens(text);
+    vector<string> tokens(str::tokens(text));
 
     // Uppercase directive and branch on valid ones
-    isc::util::str::uppercase(tokens[0]);
-    if (tokens[0] == string("$PREFIX")) {
+    str::uppercase(tokens[0]);
+    if (tokens[0] == "$PREFIX") {
         parsePrefix(tokens);
 
-    } else if (tokens[0] == string("$NAMESPACE")) {
+    } else if (tokens[0] == "$NAMESPACE") {
         parseNamespace(tokens);
 
     } else {
@@ -227,7 +228,7 @@ MessageReader::parseMessage(const std::string& text, MessageReader::Mode mode) {
     }
 
     // Strip off the introducer and any leading space after that.
-    string message_line = isc::util::str::trim(text.substr(1));
+    string message_line = str::trim(text.substr(1));
 
     // Look for the first delimiter.
     size_t first_delim = message_line.find_first_of(delimiters);
@@ -249,7 +250,7 @@ MessageReader::parseMessage(const std::string& text, MessageReader::Mode mode) {
                         LOG_INVALID_MESSAGE_ID, ident, lineno_);
         }
     }
-    isc::util::str::uppercase(ident);
+    str::uppercase(ident);
 
     // Locate the start of the message text
     size_t first_text = message_line.find_first_not_of(delimiters, first_delim);
index 2c0053c4c81ee63af6cba00fdaff17233ccdddfc..8946e5f5dc4a1333333c56d8bacccbaf09888d83 100644 (file)
@@ -35,6 +35,7 @@ libmysql_unittests_LDADD += $(top_builddir)/src/lib/database/libkea-database.la
 libmysql_unittests_LDADD += $(top_builddir)/src/lib/cc/libkea-cc.la
 libmysql_unittests_LDADD += $(top_builddir)/src/lib/asiolink/libkea-asiolink.la
 libmysql_unittests_LDADD += $(top_builddir)/src/lib/log/libkea-log.la
+libmysql_unittests_LDADD += $(top_builddir)/src/lib/util/unittests/libutil_unittests.la
 libmysql_unittests_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
 libmysql_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
 libmysql_unittests_LDADD += $(LOG4CPLUS_LIBS) $(BOOST_LIBS) $(GTEST_LDADD)
index 4e83d4bd6c4191c9cd53f97f823080f742d30fa5..1ccf6d1503d703091d5a09e840dc0c4600b136e4 100644 (file)
@@ -6,15 +6,14 @@
 
 #include <config.h>
 
-#include <log/logger_support.h>
 #include <gtest/gtest.h>
 
+#include <util/unittests/run_all.h>
+#include <log/logger_support.h>
+
 int
 main(int argc, char* argv[]) {
     ::testing::InitGoogleTest(&argc, argv);
     isc::log::initLogger();
-
-    int result = RUN_ALL_TESTS();
-
-    return (result);
+    return (isc::util::unittests::run_all());
 }
index be8b932e4ec7b1ce3dd7c75739badf4cce6d2dfe..52b906de8b032d5ec8e171d2820fa853e06df1f2 100644 (file)
@@ -33,6 +33,7 @@ libpgsql_unittests_LDADD += $(top_builddir)/src/lib/database/libkea-database.la
 libpgsql_unittests_LDADD += $(top_builddir)/src/lib/cc/libkea-cc.la
 libpgsql_unittests_LDADD += $(top_builddir)/src/lib/asiolink/libkea-asiolink.la
 libpgsql_unittests_LDADD += $(top_builddir)/src/lib/log/libkea-log.la
+libpgsql_unittests_LDADD += $(top_builddir)/src/lib/util/unittests/libutil_unittests.la
 libpgsql_unittests_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
 libpgsql_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
 libpgsql_unittests_LDADD += $(LOG4CPLUS_LIBS) $(BOOST_LIBS) $(GTEST_LDADD)
index 4e83d4bd6c4191c9cd53f97f823080f742d30fa5..1ccf6d1503d703091d5a09e840dc0c4600b136e4 100644 (file)
@@ -6,15 +6,14 @@
 
 #include <config.h>
 
-#include <log/logger_support.h>
 #include <gtest/gtest.h>
 
+#include <util/unittests/run_all.h>
+#include <log/logger_support.h>
+
 int
 main(int argc, char* argv[]) {
     ::testing::InitGoogleTest(&argc, argv);
     isc::log::initLogger();
-
-    int result = RUN_ALL_TESTS();
-
-    return (result);
+    return (isc::util::unittests::run_all());
 }
index 74bdc4377f36689c66f0c1b59c3cf4fc6cc14aa6..f201da92bc178974644794547ed2ed5f0c970f77 100644 (file)
@@ -20,7 +20,12 @@ run_unittests_SOURCES = config_report_unittests.cc run_unittests.cc
 run_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES)
 run_unittests_LDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS)
 run_unittests_LDADD  = $(top_builddir)/src/lib/process/cfgrpt/libcfgrpt.la
-run_unittests_LDADD += $(GTEST_LDADD)
+run_unittests_LDADD += $(top_builddir)/src/lib/log/libkea-log.la
+run_unittests_LDADD += $(top_builddir)/src/lib/util/unittests/libutil_unittests.la
+run_unittests_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
+run_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
+run_unittests_LDADD += $(LOG4CPLUS_LIBS)
+run_unittests_LDADD += $(BOOST_LIBS) $(GTEST_LDADD)
 
 endif
 
index feb0d8e6b70703ca380722f66e7e03b7879b19d6..c4e1d42bc9742a625ff2ad6ef5398439238d7895 100644 (file)
@@ -8,11 +8,12 @@
 
 #include <gtest/gtest.h>
 
+#include <util/unittests/run_all.h>
+#include <log/logger_support.h>
+
 int
 main(int argc, char* argv[]) {
     ::testing::InitGoogleTest(&argc, argv);
-
-    int result = RUN_ALL_TESTS();
-
-    return (result);
+    isc::log::initLogger();
+    return (isc::util::unittests::run_all());
 }
index a7c1f68dceda6232ae0b68a2c7f638d83c074f0a..5937bfd518e6c599f2568ff6cd8e0c028d991ff2 100644 (file)
@@ -7,17 +7,19 @@
 #include <config.h>
 
 #include <log/logger_support.h>
-#include <process/d_log.h>
+
 #include <gtest/gtest.h>
 
 int
 main(int argc, char* argv[]) {
+
     ::testing::InitGoogleTest(&argc, argv);
+
+    // See the documentation of the KEA_* environment variables in
+    // src/lib/log/README for info on how to tweak logging
     isc::log::initLogger();
 
-    // Override --localstatedir value for PID files
     setenv("KEA_PIDFILE_DIR", TEST_DATA_BUILDDIR, 1);
-
     int result = RUN_ALL_TESTS();
 
     return (result);
index 138a657989bcc4dcd25799796bd1512020d455d3..e041a3c7e18e2bebefcd1403dbd77fbd3a7f80cf 100644 (file)
@@ -28,6 +28,7 @@ libstats_unittests_LDADD  = $(top_builddir)/src/lib/stats/libkea-stats.la
 libstats_unittests_LDADD += $(top_builddir)/src/lib/cc/libkea-cc.la
 libstats_unittests_LDADD += $(top_builddir)/src/lib/asiolink/libkea-asiolink.la
 libstats_unittests_LDADD += $(top_builddir)/src/lib/log/libkea-log.la
+libstats_unittests_LDADD += $(top_builddir)/src/lib/util/unittests/libutil_unittests.la
 libstats_unittests_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
 libstats_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
 libstats_unittests_LDADD += $(LOG4CPLUS_LIBS) $(GTEST_LDADD) $(BOOST_LIBS)
index 9d621ae1fa89149f7cae6e31b517285f33d78cf2..561038b997ace3d25474c57b3aaf2fb3d973ec96 100644 (file)
@@ -8,11 +8,12 @@
 
 #include <gtest/gtest.h>
 
+#include <util/unittests/run_all.h>
+#include <log/logger_support.h>
+
 int
 main(int argc, char* argv[]) {
     ::testing::InitGoogleTest(&argc, argv);
-
-    int result = RUN_ALL_TESTS();
-
-    return (result);
+    isc::log::initLogger();
+    return (isc::util::unittests::run_all());
 }
index fd06ef4f218fbd3bf2cb859d5cbfec9f0ae91cf3..492c6272c7945f6fe5fb659025150931812e26b5 100644 (file)
@@ -46,8 +46,7 @@ run_unittests_LDADD += $(GTEST_LDADD)
 
 run_unittests_LDFLAGS = $(AM_LDFLAGS) $(CRYPTO_LDFLAGS) $(GTEST_LDFLAGS)
 
-# Note: the ordering matters: -Wno-... must follow -Wextra (defined in
-# KEA_CXXFLAGS)
+# Note: the ordering matters: -Wno-... must follow -Wextra (defined in KEA_CXXFLAGS)
 run_unittests_CXXFLAGS = $(AM_CXXFLAGS)
 if USE_GXX
 run_unittests_CXXFLAGS += -Wno-unused-parameter -Wno-unused-private-field
index 55589a6632d0b0b81c042144ff02019e5c10cc5a..64645f6774a1083266feefd9c888cddcb36afeb5 100644 (file)
@@ -5,16 +5,15 @@
 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 #include <config.h>
-#include <log/logger_support.h>
 
 #include <gtest/gtest.h>
 
+#include <util/unittests/run_all.h>
+#include <log/logger_support.h>
+
 int
 main(int argc, char* argv[]) {
     ::testing::InitGoogleTest(&argc, argv);
     isc::log::initLogger();
-
-    int result = RUN_ALL_TESTS();
-
-    return (result);
+    return (isc::util::unittests::run_all());
 }
index 6edffd301e88acc0d528b69d8e2160cf5fb1746f..7ab265953a7735cefe09ced5664f344e4cc86e96 100644 (file)
@@ -161,6 +161,6 @@ send_fd(const int sock, const int fd) {
     return (ret >= 0 ? 0 : FD_SYSTEM_ERROR);
 }
 
-} // End for namespace io
-} // End for namespace util
-} // End for namespace isc
+} // namespace io
+} // namespace util
+} // namespace isc
index 36d0d5fbc3a2ccb055677ccb6f28f40ca62815ae..600606f8202beb8eaf8d439a95c6218fe3613ed1 100644 (file)
@@ -4,8 +4,8 @@
 // License, v. 2.0. If a copy of the MPL was not distributed with this
 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-#ifndef FD_SHARE_H_
-#define FD_SHARE_H_
+#ifndef FD_SHARE_H
+#define FD_SHARE_H
 
 /**
  * \file fd_share.h
@@ -50,12 +50,8 @@ int recv_fd(const int sock);
  */
 int send_fd(const int sock, const int fd);
 
-} // End for namespace io
-} // End for namespace util
-} // End for namespace isc
+}  // namespace io
+}  // namespace util
+}  // namespace isc
 
-#endif
-
-// Local Variables:
-// mode: c++
-// End:
+#endif // FD_SHARE_H
index 1cb31f2028a4e0365948ff6c2a6d440732204b50..767bb0db1628a28063dbd454a42c999e1e2cac8a 100644 (file)
@@ -70,7 +70,3 @@ convertSockAddr(struct sockaddr* sa) {
 }
 
 #endif  // SOCKADDR_UTIL_H
-
-// Local Variables:
-// mode: c++
-// End:
index 52e33de64d51e697eb22990c982c7e73542c2001..6c0fac74bd1c68d24394ff8d5947ac11dbe4dc01 100644 (file)
@@ -489,7 +489,3 @@ private:
 }
 
 #endif  // SOCKETSESSION_H
-
-// Local Variables:
-// mode: c++
-// End:
index c9ae97f9dea05873a027ce89a6ee4f0c39dafc15..4edae4a8e4ad2a831f4057b29f7ab7c82bf1962b 100644 (file)
@@ -327,7 +327,3 @@ protected:
 } // namespace isc
 
 #endif // MEMORY_SEGMENT_H
-
-// Local Variables:
-// mode: c++
-// End:
index 2c0ee53db65a2113f588eb6f2f05183ab3b42f2b..0a037295a3dc54511c2f3edb0b36a80f86f1e968 100644 (file)
@@ -94,7 +94,3 @@ private:
 } // namespace isc
 
 #endif // MEMORY_SEGMENT_LOCAL_H
-
-// Local Variables:
-// mode: c++
-// End:
index f1b51f3552e41cd4f1d5458ab50220aa17d4f221..c446841101ddccc8566a9056dd838a555a681dde 100644 (file)
@@ -841,49 +841,6 @@ class SSHFP(RR):
                                                                          self.fingerprint))
         f.write('%02x %02x %s\n' % (self.algorithm, self.fingerprint_type, self.fingerprint))
 
-class MINFO(RR):
-    '''Implements rendering MINFO RDATA in the test data format.
-
-    Configurable parameters are as follows (see the description of the
-    same name of attribute for the default value):
-    - rmailbox (string): The rmailbox field.
-    - emailbox (string): The emailbox field.
-    These strings must be interpreted as a valid domain name.
-    '''
-    rmailbox = 'rmailbox.example.com'
-    emailbox = 'emailbox.example.com'
-    def dump(self, f):
-        rmailbox_wire = encode_name(self.rmailbox)
-        emailbox_wire = encode_name(self.emailbox)
-        if self.rdlen is None:
-            self.rdlen = (len(rmailbox_wire) + len(emailbox_wire)) / 2
-        else:
-            self.rdlen = int(self.rdlen)
-        self.dump_header(f, self.rdlen)
-        f.write('# RMAILBOX=%s EMAILBOX=%s\n' % (self.rmailbox, self.emailbox))
-        f.write('%s %s\n' % (rmailbox_wire, emailbox_wire))
-
-class AFSDB(RR):
-    '''Implements rendering AFSDB RDATA in the test data format.
-
-    Configurable parameters are as follows (see the description of the
-    same name of attribute for the default value):
-    - subtype (16 bit int): The subtype field.
-    - server (string): The server field.
-    The string must be interpreted as a valid domain name.
-    '''
-    subtype = 1
-    server = 'afsdb.example.com'
-    def dump(self, f):
-        server_wire = encode_name(self.server)
-        if self.rdlen is None:
-            self.rdlen = 2 + len(server_wire) / 2
-        else:
-            self.rdlen = int(self.rdlen)
-        self.dump_header(f, self.rdlen)
-        f.write('# SUBTYPE=%d SERVER=%s\n' % (self.subtype, self.server))
-        f.write('%04x %s\n' % (self.subtype, server_wire))
-
 class CAA(RR):
     '''Implements rendering CAA RDATA in the test data format.
 
@@ -1382,6 +1339,49 @@ class TSIG(RR):
         f.write('%04x%s\n' % (other_len,
                               ' ' + other_data if len(other_data) > 0 else ''))
 
+class MINFO(RR):
+    '''Implements rendering MINFO RDATA in the test data format.
+
+    Configurable parameters are as follows (see the description of the
+    same name of attribute for the default value):
+    - rmailbox (string): The rmailbox field.
+    - emailbox (string): The emailbox field.
+    These strings must be interpreted as a valid domain name.
+    '''
+    rmailbox = 'rmailbox.example.com'
+    emailbox = 'emailbox.example.com'
+    def dump(self, f):
+        rmailbox_wire = encode_name(self.rmailbox)
+        emailbox_wire = encode_name(self.emailbox)
+        if self.rdlen is None:
+            self.rdlen = (len(rmailbox_wire) + len(emailbox_wire)) / 2
+        else:
+            self.rdlen = int(self.rdlen)
+        self.dump_header(f, self.rdlen)
+        f.write('# RMAILBOX=%s EMAILBOX=%s\n' % (self.rmailbox, self.emailbox))
+        f.write('%s %s\n' % (rmailbox_wire, emailbox_wire))
+
+class AFSDB(RR):
+    '''Implements rendering AFSDB RDATA in the test data format.
+
+    Configurable parameters are as follows (see the description of the
+    same name of attribute for the default value):
+    - subtype (16 bit int): The subtype field.
+    - server (string): The server field.
+    The string must be interpreted as a valid domain name.
+    '''
+    subtype = 1
+    server = 'afsdb.example.com'
+    def dump(self, f):
+        server_wire = encode_name(self.server)
+        if self.rdlen is None:
+            self.rdlen = 2 + len(server_wire) / 2
+        else:
+            self.rdlen = int(self.rdlen)
+        self.dump_header(f, self.rdlen)
+        f.write('# SUBTYPE=%d SERVER=%s\n' % (self.subtype, self.server))
+        f.write('%04x %s\n' % (self.subtype, server_wire))
+
 # Build section-class mapping
 config_param = { 'name' : (Name, {}),
                  'header' : (DNSHeader, header_xtables),
index 1c985713b12e557162a18d6df4df7fbeb1af7f21..66c43e8f21473e305207b52519beaa2953435289 100644 (file)
@@ -42,110 +42,218 @@ protected:
 
 const uint8_t BufferTest::testdata[5] = {1, 2, 3, 4, 5};
 
+TEST_F(BufferTest, outputBufferClear) {
+    obuffer.writeData(testdata, sizeof(testdata));
+    obuffer.clear();
+    ASSERT_EQ(0, obuffer.getLength());
+    ASSERT_FALSE(obuffer.getData());
+}
+
+TEST_F(BufferTest, outputBufferCopy) {
+    ASSERT_NO_THROW({
+        obuffer.writeData(testdata, sizeof(testdata));
+
+        OutputBuffer copy(obuffer);
+        ASSERT_EQ(sizeof(testdata), copy.getLength());
+        ASSERT_NE(obuffer.getData(), copy.getData());
+        for (size_t i = 0; i < sizeof(testdata); ++i) {
+            ASSERT_EQ(testdata[i], copy[i]);
+            if (i + 1 < sizeof(testdata)) {
+                obuffer.writeUint16At(0, i);
+            }
+            ASSERT_EQ(testdata[i], copy[i]);
+        }
+        obuffer.clear();
+        ASSERT_EQ(sizeof(testdata), copy.getLength());
+    });
+}
+
+TEST_F(BufferTest, outputEmptyBufferCopy) {
+    ASSERT_NO_THROW({
+        OutputBuffer copy(obuffer);
+        ASSERT_EQ(0, copy.getLength());
+        ASSERT_FALSE(copy.getData());
+    });
+}
+
+TEST_F(BufferTest, outputBufferAssign) {
+    ASSERT_NO_THROW({
+        OutputBuffer another(0);
+        another.clear();
+        obuffer.writeData(testdata, sizeof(testdata));
+
+        another = obuffer;
+        ASSERT_EQ(sizeof(testdata), another.getLength());
+        ASSERT_NE(obuffer.getData(), another.getData());
+        for (size_t i = 0; i < sizeof(testdata); ++i) {
+            ASSERT_EQ(testdata[i], another[i]);
+            if (i + 1 < sizeof(testdata)) {
+                obuffer.writeUint16At(0, i);
+            }
+            ASSERT_EQ(testdata[i], another[i]);
+        }
+        obuffer.clear();
+        ASSERT_EQ(sizeof(testdata), another.getLength());
+    });
+}
+
+TEST_F(BufferTest, outputEmptyBufferAssign) {
+    OutputBuffer copy(0);
+    ASSERT_NO_THROW(copy = obuffer;);
+    ASSERT_EQ(0, copy.getLength());
+    ASSERT_EQ(0, copy.getData());
+}
+
+// Check assign to self doesn't break stuff
+TEST_F(BufferTest, outputBufferAssignSelf) {
+    ASSERT_NO_THROW(obuffer = obuffer);
+}
+
+TEST_F(BufferTest, inputBufferException) {
+    ASSERT_THROW(ibuffer.setPosition(6), isc::OutOfRange);
+
+    ibuffer.setPosition(sizeof(testdata));
+    ASSERT_THROW(ibuffer.peekUint8(), isc::OutOfRange);
+    ASSERT_THROW(ibuffer.readUint8(), isc::OutOfRange);
+
+    ibuffer.setPosition(sizeof(testdata) - 1);
+    ASSERT_THROW(ibuffer.peekUint16(), isc::OutOfRange);
+    ASSERT_THROW(ibuffer.readUint16(), isc::OutOfRange);
+
+    ibuffer.setPosition(sizeof(testdata) - 3);
+    ASSERT_THROW(ibuffer.peekUint32(), isc::OutOfRange);
+    ASSERT_THROW(ibuffer.readUint32(), isc::OutOfRange);
+
+    ibuffer.setPosition(sizeof(testdata) - 4);
+    ASSERT_THROW(ibuffer.peekData(vdata, sizeof(vdata)), isc::OutOfRange);
+    ASSERT_THROW(ibuffer.readData(vdata, sizeof(vdata)), isc::OutOfRange);
+    ASSERT_THROW(ibuffer.peekVector(datav, sizeof(vdata)), isc::OutOfRange);
+    ASSERT_THROW(ibuffer.readVector(datav, sizeof(vdata)), isc::OutOfRange);
+}
+
+TEST_F(BufferTest, outputBufferExtend) {
+    ASSERT_EQ(0, obuffer.getCapacity());
+    ASSERT_EQ(0, obuffer.getLength());
+    obuffer.writeUint8(10);
+    ASSERT_LT(0, obuffer.getCapacity());
+    ASSERT_EQ(1, obuffer.getLength());
+}
+
+TEST_F(BufferTest, outputBufferSkip) {
+    obuffer.skip(4);
+    ASSERT_EQ(4, obuffer.getLength());
+
+    obuffer.skip(2);
+    ASSERT_EQ(6, obuffer.getLength());
+}
+
+TEST_F(BufferTest, outputBufferTrim) {
+    obuffer.writeData(testdata, sizeof(testdata));
+    ASSERT_EQ(5, obuffer.getLength());
+
+    obuffer.trim(1);
+    ASSERT_EQ(4, obuffer.getLength());
+
+    obuffer.trim(2);
+    ASSERT_EQ(2, obuffer.getLength());
+
+    ASSERT_THROW(obuffer.trim(3), OutOfRange);
+}
+
 TEST_F(BufferTest, inputBufferRead) {
-    EXPECT_EQ(5, ibuffer.getLength());
-    EXPECT_EQ(1, ibuffer.peekUint8());
-    EXPECT_EQ(0, ibuffer.getPosition());
-    EXPECT_EQ(1, ibuffer.readUint8());
-    EXPECT_EQ(1, ibuffer.getPosition());
+    ASSERT_EQ(5, ibuffer.getLength());
+    ASSERT_EQ(1, ibuffer.peekUint8());
+    ASSERT_EQ(0, ibuffer.getPosition());
+    ASSERT_EQ(1, ibuffer.readUint8());
+    ASSERT_EQ(1, ibuffer.getPosition());
     data16 = ibuffer.peekUint16();
-    EXPECT_EQ(1, ibuffer.getPosition());
-    EXPECT_EQ(data16, ibuffer.readUint16());
-    EXPECT_EQ((2 << 8) | 3, data16);
-    EXPECT_EQ(3, ibuffer.getPosition());
+    ASSERT_EQ(1, ibuffer.getPosition());
+    ASSERT_EQ(data16, ibuffer.readUint16());
+    ASSERT_EQ((2 << 8) | 3, data16);
+    ASSERT_EQ(3, ibuffer.getPosition());
     ibuffer.setPosition(1);
-    EXPECT_EQ(1, ibuffer.getPosition());
+    ASSERT_EQ(1, ibuffer.getPosition());
     data32 = ibuffer.peekUint32();
-    EXPECT_EQ(1, ibuffer.getPosition());
-    EXPECT_EQ(data32, ibuffer.readUint32());
-    EXPECT_EQ((2 << 24) | (3 << 16) | (4 << 8) | 5, data32);
+    ASSERT_EQ(1, ibuffer.getPosition());
+    ASSERT_EQ(data32, ibuffer.readUint32());
+    ASSERT_EQ((2 << 24) | (3 << 16) | (4 << 8) | 5, data32);
     ibuffer.setPosition(0);
     memset(vdata, 0, sizeof(vdata));
     ibuffer.peekData(vdata, sizeof(vdata));
-    EXPECT_EQ(0, memcmp(vdata, testdata, sizeof(testdata)));
-    EXPECT_EQ(0, ibuffer.getPosition());
+    ASSERT_EQ(0, memcmp(vdata, testdata, sizeof(testdata)));
+    ASSERT_EQ(0, ibuffer.getPosition());
     memset(vdata, 0, sizeof(vdata));
     ibuffer.readData(vdata, sizeof(vdata));
-    EXPECT_EQ(0, memcmp(vdata, testdata, sizeof(testdata)));
-    EXPECT_EQ(sizeof(vdata), ibuffer.getPosition());
+    ASSERT_EQ(0, memcmp(vdata, testdata, sizeof(testdata)));
+    ASSERT_EQ(sizeof(vdata), ibuffer.getPosition());
     ibuffer.setPosition(0);
     datav.clear();
     ibuffer.peekVector(datav, sizeof(vdata));
     ASSERT_EQ(sizeof(vdata), datav.size());
-    EXPECT_EQ(0, memcmp(&vdata[0], testdata, sizeof(testdata)));
-    EXPECT_EQ(0, ibuffer.getPosition());
+    ASSERT_EQ(0, memcmp(&vdata[0], testdata, sizeof(testdata)));
+    ASSERT_EQ(0, ibuffer.getPosition());
     datav.clear();
     ibuffer.readVector(datav, sizeof(vdata));
     ASSERT_EQ(sizeof(vdata), datav.size());
-    EXPECT_EQ(0, memcmp(&vdata[0], testdata, sizeof(testdata)));
-    EXPECT_EQ(sizeof(vdata), ibuffer.getPosition());
+    ASSERT_EQ(0, memcmp(&vdata[0], testdata, sizeof(testdata)));
+    ASSERT_EQ(sizeof(vdata), ibuffer.getPosition());
 }
 
-TEST_F(BufferTest, inputBufferException) {
-    EXPECT_THROW(ibuffer.setPosition(6), isc::OutOfRange);
-
-    ibuffer.setPosition(sizeof(testdata));
-    EXPECT_THROW(ibuffer.peekUint8(), isc::OutOfRange);
-    EXPECT_THROW(ibuffer.readUint8(), isc::OutOfRange);
-
-    ibuffer.setPosition(sizeof(testdata) - 1);
-    EXPECT_THROW(ibuffer.peekUint16(), isc::OutOfRange);
-    EXPECT_THROW(ibuffer.readUint16(), isc::OutOfRange);
-
-    ibuffer.setPosition(sizeof(testdata) - 3);
-    EXPECT_THROW(ibuffer.peekUint32(), isc::OutOfRange);
-    EXPECT_THROW(ibuffer.readUint32(), isc::OutOfRange);
-
-    ibuffer.setPosition(sizeof(testdata) - 4);
-    EXPECT_THROW(ibuffer.peekData(vdata, sizeof(vdata)), isc::OutOfRange);
-    EXPECT_THROW(ibuffer.readData(vdata, sizeof(vdata)), isc::OutOfRange);
-    EXPECT_THROW(ibuffer.peekVector(datav, sizeof(vdata)), isc::OutOfRange);
-    EXPECT_THROW(ibuffer.readVector(datav, sizeof(vdata)), isc::OutOfRange);
+TEST_F(BufferTest, outputBufferReadAt) {
+    obuffer.writeData(testdata, sizeof(testdata));
+    for (size_t i = 0; i < sizeof(testdata); ++i) {
+        ASSERT_EQ(testdata[i], obuffer[i]);
+    }
+    ASSERT_THROW(obuffer[sizeof(testdata)], isc::OutOfRange);
 }
 
-TEST_F(BufferTest, outputBufferExtend) {
-    EXPECT_EQ(0, obuffer.getCapacity());
-    EXPECT_EQ(0, obuffer.getLength());
-    obuffer.writeUint8(10);
-    EXPECT_LT(0, obuffer.getCapacity());
-    EXPECT_EQ(1, obuffer.getLength());
+TEST_F(BufferTest, inputBufferReadVectorChunks) {
+    std::vector<uint8_t> vec;
+
+    // check that vector can read the whole buffer
+    ibuffer.readVector(vec, 3);
+    ASSERT_EQ(3, vec.size());
+    ASSERT_EQ(0, memcmp(&vec[0], testdata, 3));
+    ASSERT_NO_THROW(ibuffer.readVector(vec, 2));
+    ASSERT_EQ(2, vec.size());
+    ASSERT_EQ(0, memcmp(&vec[0], &testdata[3], 2));
 }
 
 TEST_F(BufferTest, outputBufferWrite) {
     obuffer.writeUint8(1);
     expected_size += sizeof(uint8_t);
-    EXPECT_EQ(expected_size, obuffer.getLength());
+    ASSERT_EQ(expected_size, obuffer.getLength());
     const uint8_t* cp = obuffer.getData();
-    EXPECT_EQ(1, *cp);
+    ASSERT_EQ(1, *cp);
 
     obuffer.writeUint16(data16);
     expected_size += sizeof(data16);
     cp = obuffer.getData();
-    EXPECT_EQ(expected_size, obuffer.getLength());
-    EXPECT_EQ(2, *(cp + 1));
-    EXPECT_EQ(3, *(cp + 2));
+    ASSERT_EQ(expected_size, obuffer.getLength());
+    ASSERT_EQ(2, *(cp + 1));
+    ASSERT_EQ(3, *(cp + 2));
 
     obuffer.writeUint32(data32);
     expected_size += sizeof(data32);
     cp = obuffer.getData();
-    EXPECT_EQ(expected_size, obuffer.getLength());
-    EXPECT_EQ(4, *(cp + 3));
-    EXPECT_EQ(5, *(cp + 4));
-    EXPECT_EQ(6, *(cp + 5));
-    EXPECT_EQ(7, *(cp + 6));
+    ASSERT_EQ(expected_size, obuffer.getLength());
+    ASSERT_EQ(4, *(cp + 3));
+    ASSERT_EQ(5, *(cp + 4));
+    ASSERT_EQ(6, *(cp + 5));
+    ASSERT_EQ(7, *(cp + 6));
 
     obuffer.writeData(testdata, sizeof(testdata));
     expected_size += sizeof(testdata);
-    EXPECT_EQ(expected_size, obuffer.getLength());
+    ASSERT_EQ(expected_size, obuffer.getLength());
     cp = obuffer.getData();
-    EXPECT_EQ(0, memcmp(cp + 7, testdata, sizeof(testdata)));
+    ASSERT_EQ(0, memcmp(cp + 7, testdata, sizeof(testdata)));
 
     datav = obuffer.getVector();
     ASSERT_EQ(expected_size, datav.size());
     std::vector<uint8_t> expected = { 1, 2, 3, 4, 5, 6, 7 };
     expected.insert(expected.end(), testdata, testdata + sizeof(testdata));
     ASSERT_EQ(expected_size, expected.size());
-    EXPECT_EQ(0, memcmp(&expected[0], &datav[0], expected_size));
+    ASSERT_EQ(0, memcmp(&expected[0], &datav[0], expected_size));
 }
 
 TEST_F(BufferTest, outputBufferWriteAt) {
@@ -154,138 +262,29 @@ TEST_F(BufferTest, outputBufferWriteAt) {
 
     // overwrite 2nd byte
     obuffer.writeUint8At(4, 1);
-    EXPECT_EQ(expected_size, obuffer.getLength()); // length shouldn't change
+    ASSERT_EQ(expected_size, obuffer.getLength()); // length shouldn't change
     const uint8_t* cp = obuffer.getData();
-    EXPECT_EQ(4, *(cp + 1));
+    ASSERT_EQ(4, *(cp + 1));
 
     // overwrite 2nd and 3rd bytes
     obuffer.writeUint16At(data16, 1);
-    EXPECT_EQ(expected_size, obuffer.getLength()); // length shouldn't change
+    ASSERT_EQ(expected_size, obuffer.getLength()); // length shouldn't change
     cp = obuffer.getData();
-    EXPECT_EQ(2, *(cp + 1));
-    EXPECT_EQ(3, *(cp + 2));
+    ASSERT_EQ(2, *(cp + 1));
+    ASSERT_EQ(3, *(cp + 2));
 
     // overwrite 3rd and 4th bytes
     obuffer.writeUint16At(data16, 2);
-    EXPECT_EQ(expected_size, obuffer.getLength());
+    ASSERT_EQ(expected_size, obuffer.getLength());
     cp = obuffer.getData();
-    EXPECT_EQ(2, *(cp + 2));
-    EXPECT_EQ(3, *(cp + 3));
-
-    EXPECT_THROW(obuffer.writeUint8At(data16, 5), isc::OutOfRange);
-    EXPECT_THROW(obuffer.writeUint8At(data16, 4), isc::OutOfRange);
-    EXPECT_THROW(obuffer.writeUint16At(data16, 3), isc::OutOfRange);
-    EXPECT_THROW(obuffer.writeUint16At(data16, 4), isc::OutOfRange);
-    EXPECT_THROW(obuffer.writeUint16At(data16, 5), isc::OutOfRange);
-}
-
-TEST_F(BufferTest, outputBufferSkip) {
-    obuffer.skip(4);
-    EXPECT_EQ(4, obuffer.getLength());
-
-    obuffer.skip(2);
-    EXPECT_EQ(6, obuffer.getLength());
-}
-
-TEST_F(BufferTest, outputBufferTrim) {
-    obuffer.writeData(testdata, sizeof(testdata));
-    EXPECT_EQ(5, obuffer.getLength());
-
-    obuffer.trim(1);
-    EXPECT_EQ(4, obuffer.getLength());
-
-    obuffer.trim(2);
-    EXPECT_EQ(2, obuffer.getLength());
-
-    EXPECT_THROW(obuffer.trim(3), OutOfRange);
-}
-
-TEST_F(BufferTest, outputBufferReadAt) {
-    obuffer.writeData(testdata, sizeof(testdata));
-    for (size_t i = 0; i < sizeof(testdata); ++i) {
-        EXPECT_EQ(testdata[i], obuffer[i]);
-    }
-    EXPECT_THROW(obuffer[sizeof(testdata)], isc::OutOfRange);
-}
-
-TEST_F(BufferTest, outputBufferClear) {
-    obuffer.writeData(testdata, sizeof(testdata));
-    const uint8_t* cp = obuffer.getData();
-    obuffer.clear();
-    EXPECT_EQ(0, obuffer.getLength());
-    EXPECT_FALSE(obuffer.getData());
-}
-
-TEST_F(BufferTest, outputBufferCopy) {
-    EXPECT_NO_THROW({
-        obuffer.writeData(testdata, sizeof(testdata));
-
-        OutputBuffer copy(obuffer);
-        ASSERT_EQ(sizeof(testdata), copy.getLength());
-        ASSERT_NE(obuffer.getData(), copy.getData());
-        for (size_t i = 0; i < sizeof(testdata); ++i) {
-            EXPECT_EQ(testdata[i], copy[i]);
-            if (i + 1 < sizeof(testdata)) {
-                obuffer.writeUint16At(0, i);
-            }
-            EXPECT_EQ(testdata[i], copy[i]);
-        }
-        obuffer.clear();
-        ASSERT_EQ(sizeof(testdata), copy.getLength());
-    });
-}
-
-TEST_F(BufferTest, outputEmptyBufferCopy) {
-    EXPECT_NO_THROW({
-        OutputBuffer copy(obuffer);
-        ASSERT_EQ(0, copy.getLength());
-        EXPECT_FALSE(copy.getData());
-    });
-}
-
-TEST_F(BufferTest, outputBufferAssign) {
-    EXPECT_NO_THROW({
-        OutputBuffer another(0);
-        another.clear();
-        obuffer.writeData(testdata, sizeof(testdata));
-
-        another = obuffer;
-        ASSERT_EQ(sizeof(testdata), another.getLength());
-        ASSERT_NE(obuffer.getData(), another.getData());
-        for (size_t i = 0; i < sizeof(testdata); ++i) {
-            EXPECT_EQ(testdata[i], another[i]);
-            if (i + 1 < sizeof(testdata)) {
-                obuffer.writeUint16At(0, i);
-            }
-            EXPECT_EQ(testdata[i], another[i]);
-        }
-        obuffer.clear();
-        ASSERT_EQ(sizeof(testdata), another.getLength());
-    });
-}
-
-TEST_F(BufferTest, outputEmptyBufferAssign) {
-    OutputBuffer copy(0);
-    EXPECT_NO_THROW(copy = obuffer;);
-    EXPECT_EQ(0, copy.getLength());
-    EXPECT_EQ(0, copy.getData());
-}
-
-// Check assign to self doesn't break stuff
-TEST_F(BufferTest, outputBufferAssignSelf) {
-    EXPECT_NO_THROW(obuffer = obuffer);
-}
-
-TEST_F(BufferTest, inputBufferReadVectorChunks) {
-    std::vector<uint8_t> vec;
-
-    // check that vector can read the whole buffer
-    ibuffer.readVector(vec, 3);
-    EXPECT_EQ(3, vec.size());
-    EXPECT_EQ(0, memcmp(&vec[0], testdata, 3));
-    EXPECT_NO_THROW(ibuffer.readVector(vec, 2));
-    ASSERT_EQ(2, vec.size());
-    EXPECT_EQ(0, memcmp(&vec[0], &testdata[3], 2));
+    ASSERT_EQ(2, *(cp + 2));
+    ASSERT_EQ(3, *(cp + 3));
+
+    ASSERT_THROW(obuffer.writeUint8At(data16, 5), isc::OutOfRange);
+    ASSERT_THROW(obuffer.writeUint8At(data16, 4), isc::OutOfRange);
+    ASSERT_THROW(obuffer.writeUint16At(data16, 3), isc::OutOfRange);
+    ASSERT_THROW(obuffer.writeUint16At(data16, 4), isc::OutOfRange);
+    ASSERT_THROW(obuffer.writeUint16At(data16, 5), isc::OutOfRange);
 }
 
 // Tests whether uint64 can be written properly.
@@ -298,15 +297,15 @@ TEST_F(BufferTest, writeUint64) {
     obuffer.writeUint64(val1);
     ASSERT_EQ(sizeof(uint64_t), obuffer.getLength());
     const uint8_t* cp = obuffer.getData();
-    EXPECT_TRUE(cp);
-    EXPECT_FALSE(memcmp(exp_val1, obuffer.getData(), sizeof(uint64_t)));
+    ASSERT_TRUE(cp);
+    ASSERT_FALSE(memcmp(exp_val1, obuffer.getData(), sizeof(uint64_t)));
 
-    EXPECT_NO_THROW(obuffer.clear());
+    ASSERT_NO_THROW(obuffer.clear());
     obuffer.writeUint64(val2);
     ASSERT_EQ(sizeof(uint64_t), obuffer.getLength());
     cp = obuffer.getData();
-    EXPECT_TRUE(cp);
-    EXPECT_FALSE(memcmp(exp_val2, obuffer.getData(), sizeof(uint64_t)));
+    ASSERT_TRUE(cp);
+    ASSERT_FALSE(memcmp(exp_val2, obuffer.getData(), sizeof(uint64_t)));
 }
 
 }
index 435ff12cd21dca70c8cc2c14afe06cbfc33712a0..c650878d10b17cb3b5609e938cbd017321af93d6 100644 (file)
@@ -22,7 +22,3 @@ void checkSegmentNamedAddress(MemorySegment& segment, bool out_of_segment_ok);
 }
 }
 }
-
-// Local Variables:
-// mode: c++
-// End:
index 7012f7b27025fd087ef10e099a4b843fb87faee1..4e9183a001d44a38846dcbe0c88e2c66de4ac164 100644 (file)
@@ -18,6 +18,3 @@ unsigned char parentReadState(int fd);
 }
 }
 
-// Local Variables:
-// mode: c++
-// End:
index 808cddb399dfd591ad0dcb667d00d26368853eb3..2fc2bb2d3b14adc5e3c43fd90e38757feead828b 100644 (file)
@@ -146,6 +146,3 @@ private:
 } // end of isc
 #endif  // UTIL_UNITTESTS_MOCKSOCKETSESSION_H
 
-// Local Variables:
-// mode: c++
-// End:
index 1fc3eba1134cfd80cfef20ae8a909419f727acfa..3e818e6289d37ca0ba2b3645763fe4ccb53ca75e 100644 (file)
@@ -68,7 +68,3 @@ extern size_t throw_size_on_new;
 }
 
 #endif // UTIL_UNITTESTS_NEWHOOK_H
-
-// Local Variables:
-// mode: c++
-// End:
index dfa44eecdf9f2738616c8a24fd7756838290d701..328544168b89ba229ec2cfd07aaad99b922a1c40 100644 (file)
@@ -25,7 +25,3 @@ void dontCreateCoreDumps();
 } // end of namespace isc
 
 #endif // UTIL_UNITTESTS_RESOURCE_H
-
-// Local Variables:
-// mode: c++
-// End:
index ee7c1c57536ae2aaf5d1d1c3fbbf94663178e76c..e16b5fc8ff7a81431f92f89cf00a3493a2dfc1b3 100644 (file)
@@ -40,7 +40,3 @@ void openTestData(const char* const datafile, std::ifstream& ifs);
 }
 
 #endif // UTIL_UNITTESTS_TESTDATA_H
-
-// Local Variables:
-// mode: c++
-// End:
index ae132cd10f5bcfcc67d8dabc36923c4c9baafe8a..fada98e3deaa45e9d7912ae77dc9fd51b03c2af9 100644 (file)
@@ -89,7 +89,3 @@ matchTextData(const std::string& expected_text,
 }
 
 #endif // UTIL_UNITTESTS_TEXTDATA_H
-
-// Local Variables:
-// mode: c++
-// End:
index fee555e9912a55adbd060c95c0eaec350df0018f..8c4d5ef025a6c7ef1eadb8215f3c2e5217fbcf8c 100644 (file)
@@ -31,7 +31,3 @@ void matchWireData(const void* expected_data, std::size_t expected_len,
 }
 
 #endif // UTIL_UNITTESTS_WIREDATA_H
-
-// Local Variables:
-// mode: c++
-// End:
index 24870d1f9a4472cc76865b2f97caa4d7ea6d27d6..a689ad06d2c17cd22c40f99697de259148340ff4 100644 (file)
@@ -8,14 +8,12 @@
 
 #include <gtest/gtest.h>
 
-#include <log/logger_support.h>
 #include <util/unittests/run_all.h>
+#include <log/logger_support.h>
 
 int
 main(int argc, char* argv[]) {
     ::testing::InitGoogleTest(&argc, argv);
-
     isc::log::initLogger();
-
     return (isc::util::unittests::run_all());
 }