aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_address.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2016-07-06 13:01:08 -0400
committerNick Mathewson <nickm@torproject.org>2016-07-06 13:01:08 -0400
commit08cc0ef8320e614c1a33ea5e70bef4f5809981f2 (patch)
tree8f456ed5820804a62f7788050be37d6ee8526124 /src/test/test_address.c
parent96d32f02f2f9d37454665325237cdc2adf7ee2d8 (diff)
downloadtor-08cc0ef8320e614c1a33ea5e70bef4f5809981f2.tar.gz
tor-08cc0ef8320e614c1a33ea5e70bef4f5809981f2.zip
Capture the LOG_ERR messages in our tests that had logged errors.
(It's confusing for the test to write an expected error to stdout, and then tell the user "OK".)
Diffstat (limited to 'src/test/test_address.c')
-rw-r--r--src/test/test_address.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/test/test_address.c b/src/test/test_address.c
index 3e5af56c52..d621ee5870 100644
--- a/src/test/test_address.c
+++ b/src/test/test_address.c
@@ -26,6 +26,7 @@
#include "or.h"
#include "address.h"
#include "test.h"
+#include "log_test_helpers.h"
/** Return 1 iff <b>sockaddr1</b> and <b>sockaddr2</b> represent
* the same IP address and port combination. Otherwise, return 0.
@@ -822,7 +823,10 @@ test_address_get_if_addrs6_list_no_internal(void *arg)
(void)arg;
+ int prev_level = setup_capture_of_logs(LOG_ERR); /* We might drop a log_err */
results = get_interface_address6_list(LOG_ERR, AF_INET6, 0);
+ tt_int_op(smartlist_len(mock_saved_logs()), OP_LE, 1);
+ teardown_capture_of_logs(prev_level);
tt_assert(results != NULL);
/* Work even on systems without IPv6 interfaces */
@@ -1110,7 +1114,7 @@ struct testcase_t address_tests[] = {
ADDRESS_TEST(get_if_addrs_list_internal, 0),
ADDRESS_TEST(get_if_addrs_list_no_internal, 0),
ADDRESS_TEST(get_if_addrs6_list_internal, 0),
- ADDRESS_TEST(get_if_addrs6_list_no_internal, 0),
+ ADDRESS_TEST(get_if_addrs6_list_no_internal, TT_FORK),
ADDRESS_TEST(get_if_addrs_internal_fail, 0),
ADDRESS_TEST(get_if_addrs_no_internal_fail, 0),
ADDRESS_TEST(get_if_addrs, 0),