diff options
author | Nick Mathewson <nickm@torproject.org> | 2016-09-09 10:28:12 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2016-09-09 10:28:12 -0400 |
commit | 4c55e8a58f41933e76bcb309206c98e7b5a1d834 (patch) | |
tree | dc806fb333a97fa1e6891fd3ca725e2ae8d8e05f /src/test/test_connection.c | |
parent | 2fe7e3d9d214b5cd7883ce83e5b11e14b02c5973 (diff) | |
download | tor-4c55e8a58f41933e76bcb309206c98e7b5a1d834.tar.gz tor-4c55e8a58f41933e76bcb309206c98e7b5a1d834.zip |
Fix cases where the tests were doing closesocket() on a non-socket
These seem to have caused warnings on windows. Hmmm.
Diffstat (limited to 'src/test/test_connection.c')
-rw-r--r-- | src/test/test_connection.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/test/test_connection.c b/src/test/test_connection.c index bf2cf18b96..d394fc9852 100644 --- a/src/test/test_connection.c +++ b/src/test/test_connection.c @@ -95,6 +95,13 @@ mock_connection_connect_sockaddr(connection_t *conn, return 1; } +static int +fake_close_socket(evutil_socket_t sock) +{ + (void)sock; + return 0; +} + static void test_conn_lookup_addr_helper(const char *address, int family, tor_addr_t *addr) { @@ -124,6 +131,7 @@ test_conn_get_connection(uint8_t state, uint8_t type, uint8_t purpose) MOCK(connection_connect_sockaddr, mock_connection_connect_sockaddr); + MOCK(tor_close_socket, fake_close_socket); init_connection_lists(); @@ -148,12 +156,13 @@ test_conn_get_connection(uint8_t state, uint8_t type, uint8_t purpose) assert_connection_ok(conn, time(NULL)); UNMOCK(connection_connect_sockaddr); - + UNMOCK(tor_close_socket); return conn; /* On failure */ done: UNMOCK(connection_connect_sockaddr); + UNMOCK(tor_close_socket); return NULL; } |