Commit d7c2d4ab authored by Stephen Morris's avatar Stephen Morris
Browse files

[trac1040] Further merge issues

Minor issues concerning spurious commas and a missing include file.
Also, this change fixes a couple of "missing libraries" in other
parts of the BIND 10 code.
parent 3c3ef044
......@@ -48,6 +48,7 @@ run_unittests_LDADD += $(top_builddir)/src/lib/cache/libcache.la
run_unittests_LDADD += $(top_builddir)/src/lib/nsas/libnsas.la
run_unittests_LDADD += $(top_builddir)/src/lib/resolve/libresolve.la
run_unittests_LDADD += $(top_builddir)/src/lib/acl/libacl.la
run_unittests_LDADD += $(top_builddir)/src/lib/util/libutil.la
run_unittests_LDADD += $(top_builddir)/src/lib/util/unittests/libutil_unittests.la
# Note the ordering matters: -Wno-... must follow -Wextra (defined in
......
......@@ -19,6 +19,7 @@
#include <log/logger_manager.h>
#include <log/logger_manager_impl.h>
#include <log/logger_name.h>
#include <log/logger_support.h>
#include <log/log_messages.h>
#include <log/macros.h>
#include <log/message_dictionary.h>
......
......@@ -37,10 +37,10 @@ passfail() {
echo "1. One logger, multiple destinations:"
cat > $tempfile << .
FATAL [example] LOG_WRITE_ERROR, error writing to test1: 42
ERROR [example] LOG_READING_LOCAL_FILE, reading local message file dummy/file
FATAL [example.beta] LOG_BAD_SEVERITY, unrecognized log severity: beta_fatal
ERROR [example.beta] LOG_BAD_DESTINATION, unrecognized log destination: beta_error
FATAL [example] LOG_WRITE_ERROR error writing to test1: 42
ERROR [example] LOG_READING_LOCAL_FILE reading local message file dummy/file
FATAL [example.beta] LOG_BAD_SEVERITY unrecognized log severity: beta_fatal
ERROR [example.beta] LOG_BAD_DESTINATION unrecognized log destination: beta_error
.
rm -f $destfile1 $destfile2
./logger_example -s error -f $destfile1 -f $destfile2
......@@ -61,13 +61,13 @@ rm -f $destfile1 $destfile2
# Output for example.alpha should have done to destfile2.
cat > $tempfile << .
FATAL [example] LOG_WRITE_ERROR, error writing to test1: 42
ERROR [example] LOG_READING_LOCAL_FILE, reading local message file dummy/file
WARN [example] LOG_BAD_STREAM, bad log console output stream: example
FATAL [example.beta] LOG_BAD_SEVERITY, unrecognized log severity: beta_fatal
ERROR [example.beta] LOG_BAD_DESTINATION, unrecognized log destination: beta_error
WARN [example.beta] LOG_BAD_STREAM, bad log console output stream: beta_warn
INFO [example.beta] LOG_READ_ERROR, error reading from message file beta: info
FATAL [example] LOG_WRITE_ERROR error writing to test1: 42
ERROR [example] LOG_READING_LOCAL_FILE reading local message file dummy/file
WARN [example] LOG_BAD_STREAM bad log console output stream: example
FATAL [example.beta] LOG_BAD_SEVERITY unrecognized log severity: beta_fatal
ERROR [example.beta] LOG_BAD_DESTINATION unrecognized log destination: beta_error
WARN [example.beta] LOG_BAD_STREAM bad log console output stream: beta_warn
INFO [example.beta] LOG_READ_ERROR error reading from message file beta: info
.
echo -n " - destination 1:"
cut -d' ' -f3- $destfile1 | diff $tempfile -
......@@ -75,7 +75,7 @@ passfail $?
echo -n " - destination 2:"
cat > $tempfile << .
WARN [example.alpha] LOG_READ_ERROR, error reading from message file a.txt: dummy reason
WARN [example.alpha] LOG_READ_ERROR error reading from message file a.txt: dummy reason
.
cut -d' ' -f3- $destfile2 | diff $tempfile -
passfail $?
......
......@@ -44,28 +44,28 @@ cat > $localmes << .
echo -n "1. Local message replacement:"
cat > $tempfile << .
WARN [example.log] LOG_NO_SUCH_MESSAGE, could not replace message text for 'LOG_NOTHERE': no such message
FATAL [example] LOG_WRITE_ERROR, error writing to test1: 42
ERROR [example] LOG_READING_LOCAL_FILE, replacement read local message file, parameter is 'dummy/file'
WARN [example] LOG_BAD_STREAM, bad log console output stream: example
WARN [example.alpha] LOG_READ_ERROR, replacement read error, parameters: 'a.txt' and 'dummy reason'
FATAL [example.beta] LOG_BAD_SEVERITY, unrecognized log severity: beta_fatal
ERROR [example.beta] LOG_BAD_DESTINATION, unrecognized log destination: beta_error
WARN [example.beta] LOG_BAD_STREAM, bad log console output stream: beta_warn
WARN [example.log] LOG_NO_SUCH_MESSAGE could not replace message text for 'LOG_NOTHERE': no such message
FATAL [example] LOG_WRITE_ERROR error writing to test1: 42
ERROR [example] LOG_READING_LOCAL_FILE replacement read local message file, parameter is 'dummy/file'
WARN [example] LOG_BAD_STREAM bad log console output stream: example
WARN [example.alpha] LOG_READ_ERROR replacement read error, parameters: 'a.txt' and 'dummy reason'
FATAL [example.beta] LOG_BAD_SEVERITY unrecognized log severity: beta_fatal
ERROR [example.beta] LOG_BAD_DESTINATION unrecognized log destination: beta_error
WARN [example.beta] LOG_BAD_STREAM bad log console output stream: beta_warn
.
./logger_example -c stdout -s warn $localmes | cut -d' ' -f3- | diff $tempfile -
passfail $?
echo -n "2. Report error if unable to read local message file:"
cat > $tempfile << .
ERROR [example.log] LOG_INPUT_OPEN_FAIL, unable to open message file $localmes for input: No such file or directory
FATAL [example] LOG_WRITE_ERROR, error writing to test1: 42
ERROR [example] LOG_READING_LOCAL_FILE, reading local message file dummy/file
WARN [example] LOG_BAD_STREAM, bad log console output stream: example
WARN [example.alpha] LOG_READ_ERROR, error reading from message file a.txt: dummy reason
FATAL [example.beta] LOG_BAD_SEVERITY, unrecognized log severity: beta_fatal
ERROR [example.beta] LOG_BAD_DESTINATION, unrecognized log destination: beta_error
WARN [example.beta] LOG_BAD_STREAM, bad log console output stream: beta_warn
ERROR [example.log] LOG_INPUT_OPEN_FAIL unable to open message file $localmes for input: No such file or directory
FATAL [example] LOG_WRITE_ERROR error writing to test1: 42
ERROR [example] LOG_READING_LOCAL_FILE reading local message file dummy/file
WARN [example] LOG_BAD_STREAM bad log console output stream: example
WARN [example.alpha] LOG_READ_ERROR error reading from message file a.txt: dummy reason
FATAL [example.beta] LOG_BAD_SEVERITY unrecognized log severity: beta_fatal
ERROR [example.beta] LOG_BAD_DESTINATION unrecognized log destination: beta_error
WARN [example.beta] LOG_BAD_STREAM bad log console output stream: beta_warn
.
rm -f $localmes
./logger_example -c stdout -s warn $localmes | cut -d' ' -f3- | diff $tempfile -
......
......@@ -14,7 +14,7 @@
#include <gtest/gtest.h>
#include <log/logger_support.h>
#include <log/messagedef.h>
#include <log/log_messages.h>
using namespace isc::log;
......@@ -63,10 +63,10 @@ TEST(LoggerSupportTest, LoggingInitializationCheck) {
isc::log::Logger test_logger("test");
EXPECT_THROW(test_logger.isDebugEnabled(), LoggingNotInitialized);
EXPECT_THROW(test_logger.info(MSG_OPENIN), LoggingNotInitialized);
EXPECT_THROW(test_logger.info(LOG_INPUT_OPEN_FAIL), LoggingNotInitialized);
// ... and check that they work when logging is initialized.
setLoggingInitialized(true);
EXPECT_NO_THROW(test_logger.isDebugEnabled());
EXPECT_NO_THROW(test_logger.info(MSG_OPENIN));
EXPECT_NO_THROW(test_logger.info(LOG_INPUT_OPEN_FAIL));
}
......@@ -35,44 +35,44 @@ passfail() {
echo -n "1. runInitTest default parameters:"
cat > $tempfile << .
FATAL [example] LOG_WRITE_ERROR, error writing to test1: 42
ERROR [example] LOG_READING_LOCAL_FILE, reading local message file dummy/file
WARN [example] LOG_BAD_STREAM, bad log console output stream: example
WARN [example.alpha] LOG_READ_ERROR, error reading from message file a.txt: dummy reason
INFO [example.alpha] LOG_INPUT_OPEN_FAIL, unable to open message file example.msg for input: dummy reason
FATAL [example.beta] LOG_BAD_SEVERITY, unrecognized log severity: beta_fatal
ERROR [example.beta] LOG_BAD_DESTINATION, unrecognized log destination: beta_error
WARN [example.beta] LOG_BAD_STREAM, bad log console output stream: beta_warn
INFO [example.beta] LOG_READ_ERROR, error reading from message file beta: info
FATAL [example] LOG_WRITE_ERROR error writing to test1: 42
ERROR [example] LOG_READING_LOCAL_FILE reading local message file dummy/file
WARN [example] LOG_BAD_STREAM bad log console output stream: example
WARN [example.alpha] LOG_READ_ERROR error reading from message file a.txt: dummy reason
INFO [example.alpha] LOG_INPUT_OPEN_FAIL unable to open message file example.msg for input: dummy reason
FATAL [example.beta] LOG_BAD_SEVERITY unrecognized log severity: beta_fatal
ERROR [example.beta] LOG_BAD_DESTINATION unrecognized log destination: beta_error
WARN [example.beta] LOG_BAD_STREAM bad log console output stream: beta_warn
INFO [example.beta] LOG_READ_ERROR error reading from message file beta: info
.
./logger_example -c stdout | cut -d' ' -f3- | diff $tempfile -
passfail $?
echo -n "2. Severity filter:"
cat > $tempfile << .
FATAL [example] LOG_WRITE_ERROR, error writing to test1: 42
ERROR [example] LOG_READING_LOCAL_FILE, reading local message file dummy/file
FATAL [example.beta] LOG_BAD_SEVERITY, unrecognized log severity: beta_fatal
ERROR [example.beta] LOG_BAD_DESTINATION, unrecognized log destination: beta_error
FATAL [example] LOG_WRITE_ERROR error writing to test1: 42
ERROR [example] LOG_READING_LOCAL_FILE reading local message file dummy/file
FATAL [example.beta] LOG_BAD_SEVERITY unrecognized log severity: beta_fatal
ERROR [example.beta] LOG_BAD_DESTINATION unrecognized log destination: beta_error
.
./logger_example -c stdout -s error | cut -d' ' -f3- | diff $tempfile -
passfail $?
echo -n "3. Debug level:"
cat > $tempfile << .
FATAL [example] LOG_WRITE_ERROR, error writing to test1: 42
ERROR [example] LOG_READING_LOCAL_FILE, reading local message file dummy/file
WARN [example] LOG_BAD_STREAM, bad log console output stream: example
WARN [example.alpha] LOG_READ_ERROR, error reading from message file a.txt: dummy reason
INFO [example.alpha] LOG_INPUT_OPEN_FAIL, unable to open message file example.msg for input: dummy reason
DEBUG [example] LOG_READING_LOCAL_FILE, reading local message file example/0
DEBUG [example] LOG_READING_LOCAL_FILE, reading local message file example/24
DEBUG [example] LOG_READING_LOCAL_FILE, reading local message file example/25
FATAL [example.beta] LOG_BAD_SEVERITY, unrecognized log severity: beta_fatal
ERROR [example.beta] LOG_BAD_DESTINATION, unrecognized log destination: beta_error
WARN [example.beta] LOG_BAD_STREAM, bad log console output stream: beta_warn
INFO [example.beta] LOG_READ_ERROR, error reading from message file beta: info
DEBUG [example.beta] LOG_BAD_SEVERITY, unrecognized log severity: beta/25
FATAL [example] LOG_WRITE_ERROR error writing to test1: 42
ERROR [example] LOG_READING_LOCAL_FILE reading local message file dummy/file
WARN [example] LOG_BAD_STREAM bad log console output stream: example
WARN [example.alpha] LOG_READ_ERROR error reading from message file a.txt: dummy reason
INFO [example.alpha] LOG_INPUT_OPEN_FAIL unable to open message file example.msg for input: dummy reason
DEBUG [example] LOG_READING_LOCAL_FILE reading local message file example/0
DEBUG [example] LOG_READING_LOCAL_FILE reading local message file example/24
DEBUG [example] LOG_READING_LOCAL_FILE reading local message file example/25
FATAL [example.beta] LOG_BAD_SEVERITY unrecognized log severity: beta_fatal
ERROR [example.beta] LOG_BAD_DESTINATION unrecognized log destination: beta_error
WARN [example.beta] LOG_BAD_STREAM bad log console output stream: beta_warn
INFO [example.beta] LOG_READ_ERROR error reading from message file beta: info
DEBUG [example.beta] LOG_BAD_SEVERITY unrecognized log severity: beta/25
.
./logger_example -c stdout -s debug -d 25 | cut -d' ' -f3- | diff $tempfile -
passfail $?
......
......@@ -38,6 +38,8 @@ run_unittests_LDADD += $(top_builddir)/src/lib/server_common/libserver_common.la
run_unittests_LDADD += $(top_builddir)/src/lib/asiolink/libasiolink.la
run_unittests_LDADD += $(top_builddir)/src/lib/asiodns/libasiodns.la
run_unittests_LDADD += $(top_builddir)/src/lib/cc/libcc.la
run_unittests_LDADD += $(top_builddir)/src/lib/acl/libacl.la
run_unittests_LDADD += $(top_builddir)/src/lib/util/libutil.la
run_unittests_LDADD += $(top_builddir)/src/lib/dns/libdns++.la
run_unittests_LDADD += $(top_builddir)/src/lib/util/unittests/libutil_unittests.la
run_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libexceptions.la
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment