Add relay crypto mock points for tests.

Co-authored-by: George Kadianakis <desnacked@riseup.net>
This commit is contained in:
Mike Perry 2018-08-23 20:31:16 +00:00 committed by George Kadianakis
parent 9aaf72ea58
commit d62340018c
2 changed files with 8 additions and 3 deletions

View File

@ -355,11 +355,11 @@ circuit_receive_relay_cell(cell_t *cell, circuit_t *circ,
* - Encrypt it to the right layer * - Encrypt it to the right layer
* - Append it to the appropriate cell_queue on <b>circ</b>. * - Append it to the appropriate cell_queue on <b>circ</b>.
*/ */
static int MOCK_IMPL(int,
circuit_package_relay_cell(cell_t *cell, circuit_t *circ, circuit_package_relay_cell, (cell_t *cell, circuit_t *circ,
cell_direction_t cell_direction, cell_direction_t cell_direction,
crypt_path_t *layer_hint, streamid_t on_stream, crypt_path_t *layer_hint, streamid_t on_stream,
const char *filename, int lineno) const char *filename, int lineno))
{ {
channel_t *chan; /* where to send the cell */ channel_t *chan; /* where to send the cell */

View File

@ -78,6 +78,11 @@ void destroy_cell_queue_append(destroy_cell_queue_t *queue,
void channel_unlink_all_circuits(channel_t *chan, smartlist_t *detached_out); void channel_unlink_all_circuits(channel_t *chan, smartlist_t *detached_out);
MOCK_DECL(int, channel_flush_from_first_active_circuit, MOCK_DECL(int, channel_flush_from_first_active_circuit,
(channel_t *chan, int max)); (channel_t *chan, int max));
MOCK_DECL(int, circuit_package_relay_cell, (cell_t *cell, circuit_t *circ,
cell_direction_t cell_direction,
crypt_path_t *layer_hint, streamid_t on_stream,
const char *filename, int lineno));
void update_circuit_on_cmux_(circuit_t *circ, cell_direction_t direction, void update_circuit_on_cmux_(circuit_t *circ, cell_direction_t direction,
const char *file, int lineno); const char *file, int lineno);
#define update_circuit_on_cmux(circ, direction) \ #define update_circuit_on_cmux(circ, direction) \