aboutsummaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorTaylor Yu <catalyst@torproject.org>2018-05-03 20:57:07 -0500
committerTaylor Yu <catalyst@torproject.org>2018-05-08 17:59:03 -0500
commitc223377ce60ed07a11e0c3b5af29601722b07bac (patch)
tree6e7aa694048ee5a2f84a99a42173c7cba577b7fa /src/or
parent5bd2060054095f590559beb57b46c353476084f0 (diff)
downloadtor-c223377ce60ed07a11e0c3b5af29601722b07bac.tar.gz
tor-c223377ce60ed07a11e0c3b5af29601722b07bac.zip
Make clock_skew_warning() mockable
Diffstat (limited to 'src/or')
-rw-r--r--src/or/connection.c8
-rw-r--r--src/or/connection.h7
2 files changed, 8 insertions, 7 deletions
diff --git a/src/or/connection.c b/src/or/connection.c
index 4361e1ca0c..fa9881cb8b 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -5233,10 +5233,10 @@ connection_free_all(void)
* that we had more faith in and therefore the warning level should have higher
* severity.
*/
-void
-clock_skew_warning(const connection_t *conn, long apparent_skew, int trusted,
- log_domain_mask_t domain, const char *received,
- const char *source)
+MOCK_IMPL(void,
+clock_skew_warning, (const connection_t *conn, long apparent_skew, int trusted,
+ log_domain_mask_t domain, const char *received,
+ const char *source))
{
char dbuf[64];
char *ext_source = NULL, *warn = NULL;
diff --git a/src/or/connection.h b/src/or/connection.h
index a2dce2435f..ad3129c9d8 100644
--- a/src/or/connection.h
+++ b/src/or/connection.h
@@ -254,9 +254,10 @@ void assert_connection_ok(connection_t *conn, time_t now);
int connection_or_nonopen_was_started_here(or_connection_t *conn);
void connection_dump_buffer_mem_stats(int severity);
-void clock_skew_warning(const connection_t *conn, long apparent_skew,
- int trusted, log_domain_mask_t domain,
- const char *received, const char *source);
+MOCK_DECL(void, clock_skew_warning,
+ (const connection_t *conn, long apparent_skew, int trusted,
+ log_domain_mask_t domain, const char *received,
+ const char *source));
/** Check if a connection is on the way out so the OOS handler doesn't try
* to kill more than it needs. */