aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_circuitstats.c
diff options
context:
space:
mode:
authorteor <teor@riseup.net>2020-05-14 10:44:56 +1000
committerteor <teor@riseup.net>2020-05-14 10:44:56 +1000
commitd41d13ea73e0b5b7023a43e7d13d8738f2e59855 (patch)
tree74e337701c513126f40e6576b51fdcf50b98ad00 /src/test/test_circuitstats.c
parent9949b545c8890abfb192ce4d2397e0db959645b7 (diff)
downloadtor-d41d13ea73e0b5b7023a43e7d13d8738f2e59855.tar.gz
tor-d41d13ea73e0b5b7023a43e7d13d8738f2e59855.zip
test: Move the origin circuit function to test helpers
Part of 33222.
Diffstat (limited to 'src/test/test_circuitstats.c')
-rw-r--r--src/test/test_circuitstats.c39
1 files changed, 0 insertions, 39 deletions
diff --git a/src/test/test_circuitstats.c b/src/test/test_circuitstats.c
index 4322da189c..00ca1b544c 100644
--- a/src/test/test_circuitstats.c
+++ b/src/test/test_circuitstats.c
@@ -16,19 +16,11 @@
#include "core/or/circuitstats.h"
#include "core/or/circuituse.h"
#include "core/or/channel.h"
-#include "core/or/crypt_path.h"
-#include "core/or/cpath_build_state_st.h"
#include "core/or/crypt_path_st.h"
#include "core/or/extend_info_st.h"
#include "core/or/origin_circuit_st.h"
-static origin_circuit_t *new_test_origin_circuit(
- bool has_opened,
- struct timeval circ_start_time,
- int path_len,
- extend_info_t **ei_list);
-
static origin_circuit_t *add_opened_threehop(void);
static origin_circuit_t *build_unopened_fourhop(struct timeval);
static origin_circuit_t *subtest_fourhop_circuit(struct timeval, int);
@@ -49,37 +41,6 @@ mock_circuit_mark_for_close(circuit_t *circ, int reason, int line,
}
static origin_circuit_t *
-new_test_origin_circuit(bool has_opened,
- struct timeval circ_start_time,
- int path_len,
- extend_info_t **ei_list)
-{
- origin_circuit_t *origin_circ = origin_circuit_new();
-
- TO_CIRCUIT(origin_circ)->purpose = CIRCUIT_PURPOSE_C_GENERAL;
-
- origin_circ->build_state = tor_malloc_zero(sizeof(cpath_build_state_t));
- origin_circ->build_state->desired_path_len = path_len;
-
- if (ei_list) {
- for (int i = 0; i < path_len; i++) {
- extend_info_t *ei = ei_list[i];
- cpath_append_hop(&origin_circ->cpath, ei);
- }
- }
-
- if (has_opened) {
- origin_circ->has_opened = 1;
- TO_CIRCUIT(origin_circ)->state = CIRCUIT_STATE_OPEN;
- } else {
- TO_CIRCUIT(origin_circ)->timestamp_began = circ_start_time;
- TO_CIRCUIT(origin_circ)->timestamp_created = circ_start_time;
- }
-
- return origin_circ;
-}
-
-static origin_circuit_t *
add_opened_threehop(void)
{
struct timeval circ_start_time;