summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorteor <teor2345@gmail.com>2016-11-16 13:03:20 +1100
committerteor <teor2345@gmail.com>2016-11-16 13:14:00 +1100
commit150a2b39b0efc17205bef07845e7a6d68b8c5148 (patch)
treee875cdfdfe4c854e63e7c71aad2872f26d0feb91 /src
parent0825fc6af90b2015cb6a4abe6b8682f6f44d64e2 (diff)
downloadtor-150a2b39b0efc17205bef07845e7a6d68b8c5148.tar.gz
tor-150a2b39b0efc17205bef07845e7a6d68b8c5148.zip
fixup! Add expect_log_msg_containing_either3() and expect_log_msg_containing_either4()
Fix typos: * extra '(' * use assert_log_predicate (without 3 or 4 at the end) Tidy whitespace. Wrap long lines.
Diffstat (limited to 'src')
-rw-r--r--src/test/log_test_helpers.h28
-rw-r--r--src/test/test_address.c15
2 files changed, 24 insertions, 19 deletions
diff --git a/src/test/log_test_helpers.h b/src/test/log_test_helpers.h
index a8ad7e8cc0..922c68b42f 100644
--- a/src/test/log_test_helpers.h
+++ b/src/test/log_test_helpers.h
@@ -49,22 +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);
-
-#define expect_log_msg_containing_either3(str1, str2, str3) \
- assert_log_predicate3(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_predicate4(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);
+ "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 fa32cf9634..0d142ad483 100644
--- a/src/test/test_address.c
+++ b/src/test/test_address.c
@@ -810,8 +810,11 @@ test_address_get_if_addrs6_list_internal(void *arg)
if (smartlist_len(mock_saved_logs()) == 1) {
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");
+ "Address that we determined via UDP "
+ "socket magic is unsuitable for public "
+ "comms.",
+ "getsockname() to determine interface "
+ "failed");
}
teardown_capture_of_logs();
@@ -850,9 +853,11 @@ test_address_get_if_addrs6_list_no_internal(void *arg)
if (smartlist_len(mock_saved_logs()) == 1) {
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");
-
+ "Address that we determined via UDP "
+ "socket magic is unsuitable for public "
+ "comms.",
+ "getsockname() to determine interface "
+ "failed");
}
teardown_capture_of_logs();