more consistent use of expect_log_msg_containing

This commit is contained in:
Nick Mathewson 2016-09-08 11:16:09 -04:00
parent f64f293c48
commit f9cb9d8990
2 changed files with 4 additions and 7 deletions

View File

@ -344,8 +344,7 @@ test_link_handshake_recv_certs_ok_server(void *arg)
tt_int_op(0, ==, mock_send_authenticate_called); \ tt_int_op(0, ==, mock_send_authenticate_called); \
tt_int_op(0, ==, mock_send_netinfo_called); \ tt_int_op(0, ==, mock_send_netinfo_called); \
if (require_failure_message) { \ if (require_failure_message) { \
tt_assert(mock_saved_log_has_message_containing( \ expect_log_msg_containing(require_failure_message); \
require_failure_message)); \
} \ } \
done: \ done: \
teardown_capture_of_logs(prev_level); \ teardown_capture_of_logs(prev_level); \
@ -622,8 +621,7 @@ test_link_handshake_recv_authchallenge_ok_unrecognized(void *arg)
tt_int_op(0, ==, mock_send_authenticate_called); \ tt_int_op(0, ==, mock_send_authenticate_called); \
tt_int_op(0, ==, mock_send_netinfo_called); \ tt_int_op(0, ==, mock_send_netinfo_called); \
if (require_failure_message) { \ if (require_failure_message) { \
tt_assert(mock_saved_log_has_message_containing( \ expect_log_msg_containing(require_failure_message); \
require_failure_message)); \
} \ } \
done: \ done: \
teardown_capture_of_logs(prev_level); \ teardown_capture_of_logs(prev_level); \
@ -862,8 +860,7 @@ test_link_handshake_auth_cell(void *arg)
tt_int_op(mock_close_called, ==, 1); \ tt_int_op(mock_close_called, ==, 1); \
tt_int_op(d->c2->handshake_state->authenticated, ==, 0); \ tt_int_op(d->c2->handshake_state->authenticated, ==, 0); \
if (require_failure_message) { \ if (require_failure_message) { \
tt_assert(mock_saved_log_has_message_containing( \ expect_log_msg_containing(require_failure_message); \
require_failure_message)); \
} \ } \
done: \ done: \
teardown_capture_of_logs(prev_level); \ teardown_capture_of_logs(prev_level); \

View File

@ -651,7 +651,7 @@ test_util_time(void *arg)
old_log_level = setup_full_capture_of_logs(LOG_WARN); \ old_log_level = setup_full_capture_of_logs(LOG_WARN); \
} while (0) } while (0)
#define CHECK_TIMEGM_WARNING(msg) do { \ #define CHECK_TIMEGM_WARNING(msg) do { \
tt_assert(mock_saved_log_has_message_containing(msg)); \ expect_log_msg_containing(msg); \
tt_int_op(1, OP_EQ, smartlist_len(mock_saved_logs())); \ tt_int_op(1, OP_EQ, smartlist_len(mock_saved_logs())); \
teardown_capture_of_logs(old_log_level); \ teardown_capture_of_logs(old_log_level); \
} while (0) } while (0)