diff options
author | Chelsea H. Komlo <chelsea.komlo@gmail.com> | 2016-11-02 09:45:02 -0500 |
---|---|---|
committer | Chelsea H. Komlo <chelsea.komlo@gmail.com> | 2016-11-24 08:12:33 -0500 |
commit | 118bba7622ab15ea5c58ff32be178820150423ba (patch) | |
tree | 84b46f7a30af14b70b8533102f6b6cb56f72c9dd /src/test/test_circuituse.c | |
parent | cfb8363da9210ba3df92a0b6a572b8c3c5adcf9b (diff) | |
download | tor-118bba7622ab15ea5c58ff32be178820150423ba.tar.gz tor-118bba7622ab15ea5c58ff32be178820150423ba.zip |
Refactor to remove unnecessary check in circuit_is_available_for_use
Diffstat (limited to 'src/test/test_circuituse.c')
-rw-r--r-- | src/test/test_circuituse.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/test/test_circuituse.c b/src/test/test_circuituse.c index 23f1f9c6d2..edbc9f6391 100644 --- a/src/test/test_circuituse.c +++ b/src/test/test_circuituse.c @@ -46,7 +46,21 @@ test_circuit_is_available_for_use_ret_false_for_non_general_purpose(void *arg) (void)arg; circuit_t *circ = tor_malloc(sizeof(circuit_t)); - circ->purpose = CIRCUIT_PURPOSE_OR; + circ->purpose = CIRCUIT_PURPOSE_REND_POINT_WAITING; + + tt_int_op(0, ==, circuit_is_available_for_use(circ)); + + done: + tor_free(circ); +} + +static void +test_circuit_is_available_for_use_ret_false_for_non_general_origin(void *arg) +{ + (void)arg; + + circuit_t *circ = tor_malloc(sizeof(circuit_t)); + circ->purpose = CIRCUIT_PURPOSE_C_INTRODUCE_ACK_WAIT; tt_int_op(0, ==, circuit_is_available_for_use(circ)); @@ -235,6 +249,10 @@ struct testcase_t circuituse_tests[] = { test_circuit_is_available_for_use_ret_false_for_non_general_purpose, TT_FORK, NULL, NULL }, + { "non_general", + test_circuit_is_available_for_use_ret_false_for_non_general_origin, + TT_FORK, NULL, NULL + }, { "origin", test_circuit_is_available_for_use_ret_false_for_non_origin_purpose, TT_FORK, NULL, NULL |