]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
circuitbuild: Make some functions mockable
authorteor <teor@torproject.org>
Fri, 3 Apr 2020 09:01:19 +0000 (19:01 +1000)
committerteor <teor@torproject.org>
Thu, 9 Apr 2020 01:00:04 +0000 (11:00 +1000)
Part of 33633.

src/core/or/circuitbuild.c
src/core/or/circuitbuild.h

index 0527548f274954469151b06384a83ae69a8cebf2..71a51e61a4ce54818e4c28d3590f5a55c9232ae5 100644 (file)
@@ -95,10 +95,10 @@ static const node_t *choose_good_middle_server(uint8_t purpose,
  * and then calls command_setup_channel() to give it the right
  * callbacks.
  */
-channel_t *
-channel_connect_for_circuit(const tor_addr_t *addr, uint16_t port,
-                            const char *id_digest,
-                            const struct ed25519_public_key_t *ed_id)
+MOCK_IMPL(channel_t *,
+channel_connect_for_circuit,(const tor_addr_t *addr, uint16_t port,
+                             const char *id_digest,
+                             const struct ed25519_public_key_t *ed_id))
 {
   channel_t *chan;
 
index c66c0dc752ab05fdef1e2deaad79f1ba131a4f67..cf999909275ebd891072aadf55ceeb388de2aedc 100644 (file)
@@ -73,13 +73,13 @@ void circuit_upgrade_circuits_from_guard_wait(void);
 
 struct ed25519_public_key_t;
 
-channel_t *
-channel_connect_for_circuit(const tor_addr_t *addr,
-                            uint16_t port,
-                            const char *id_digest,
-                            const struct ed25519_public_key_t *ed_id);
-struct create_cell_t;
+MOCK_DECL(channel_t *,
+channel_connect_for_circuit,(const tor_addr_t *addr,
+                             uint16_t port,
+                             const char *id_digest,
+                             const struct ed25519_public_key_t *ed_id));
 
+struct create_cell_t;
 int
 circuit_deliver_create_cell(circuit_t *circ,
                             const struct create_cell_t *create_cell,