aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2016-11-17 20:08:15 -0500
committerNick Mathewson <nickm@torproject.org>2016-11-17 20:08:15 -0500
commit427dcb29b573d839551e8e3982af6e40d7d42609 (patch)
treecdf701cdbed69bfc9169e39896c16378ab94e466 /src
parentb7db39e88ab6d97a5a0a5f1ff7e0d5b73e51e05e (diff)
parent8a767ba7fbeedb3d8838ccfe57583203b783241d (diff)
downloadtor-427dcb29b573d839551e8e3982af6e40d7d42609.tar.gz
tor-427dcb29b573d839551e8e3982af6e40d7d42609.zip
Merge branch 'maint-0.2.9'
Diffstat (limited to 'src')
-rw-r--r--src/test/log_test_helpers.h17
-rw-r--r--src/test/test_address.c18
2 files changed, 30 insertions, 5 deletions
diff --git a/src/test/log_test_helpers.h b/src/test/log_test_helpers.h
index 4c020c7ec3..922c68b42f 100644
--- a/src/test/log_test_helpers.h
+++ b/src/test/log_test_helpers.h
@@ -49,7 +49,22 @@ void mock_dump_saved_logs(void);
#define expect_log_msg_containing_either(str1, str2) \
assert_log_predicate(mock_saved_log_has_message_containing(str1) || \
mock_saved_log_has_message_containing(str2), \
- "expected log to contain " # str1 " or " # str2);
+ "expected log to contain " # str1 " or " # str2);
+
+#define expect_log_msg_containing_either3(str1, str2, str3) \
+ assert_log_predicate(mock_saved_log_has_message_containing(str1) || \
+ mock_saved_log_has_message_containing(str2) || \
+ mock_saved_log_has_message_containing(str3), \
+ "expected log to contain " # str1 " or " # str2 \
+ " or " # str3);
+
+#define expect_log_msg_containing_either4(str1, str2, str3, str4) \
+ assert_log_predicate(mock_saved_log_has_message_containing(str1) || \
+ mock_saved_log_has_message_containing(str2) || \
+ mock_saved_log_has_message_containing(str3) || \
+ mock_saved_log_has_message_containing(str4), \
+ "expected log to contain " # str1 " or " # str2 \
+ " or " # str3 " or " # str4);
#define expect_single_log_msg(str) \
do { \
diff --git a/src/test/test_address.c b/src/test/test_address.c
index e52779cb64..0d142ad483 100644
--- a/src/test/test_address.c
+++ b/src/test/test_address.c
@@ -808,8 +808,13 @@ test_address_get_if_addrs6_list_internal(void *arg)
results = get_interface_address6_list(LOG_ERR, AF_INET6, 1);
tt_int_op(smartlist_len(mock_saved_logs()), OP_LE, 1);
if (smartlist_len(mock_saved_logs()) == 1) {
- expect_log_msg_containing_either("connect() failed",
- "unable to create socket");
+ expect_log_msg_containing_either4("connect() failed",
+ "unable to create socket",
+ "Address that we determined via UDP "
+ "socket magic is unsuitable for public "
+ "comms.",
+ "getsockname() to determine interface "
+ "failed");
}
teardown_capture_of_logs();
@@ -846,8 +851,13 @@ test_address_get_if_addrs6_list_no_internal(void *arg)
results = get_interface_address6_list(LOG_ERR, AF_INET6, 0);
tt_int_op(smartlist_len(mock_saved_logs()), OP_LE, 1);
if (smartlist_len(mock_saved_logs()) == 1) {
- expect_log_msg_containing_either("connect() failed",
- "unable to create socket");
+ expect_log_msg_containing_either4("connect() failed",
+ "unable to create socket",
+ "Address that we determined via UDP "
+ "socket magic is unsuitable for public "
+ "comms.",
+ "getsockname() to determine interface "
+ "failed");
}
teardown_capture_of_logs();