diff options
author | Nick Mathewson <nickm@torproject.org> | 2016-09-08 15:01:32 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2016-09-08 15:03:11 -0400 |
commit | deb294ff532d074a7d4094518c296fe69f819874 (patch) | |
tree | 3a49b6c30ab041807a025fa463ff57ca328165db /src/test/test_circuitlist.c | |
parent | b0a9e54705d16d08ae7aff272492832dbb35646d (diff) | |
download | tor-deb294ff532d074a7d4094518c296fe69f819874.tar.gz tor-deb294ff532d074a7d4094518c296fe69f819874.zip |
Simplify log_test_helpers interface
Previously, you needed to store the previous log severity in a local
variable, and it wasn't clear if you were allowed to call these
functions more than once.
Diffstat (limited to 'src/test/test_circuitlist.c')
-rw-r--r-- | src/test/test_circuitlist.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/test/test_circuitlist.c b/src/test/test_circuitlist.c index 688515ce5f..b233e99328 100644 --- a/src/test/test_circuitlist.c +++ b/src/test/test_circuitlist.c @@ -285,7 +285,6 @@ test_pick_circid(void *arg) circid_t circid; int i; (void) arg; - int prev_level = 0; MOCK(channel_dump_statistics, mock_channel_dump_statistics); @@ -298,12 +297,11 @@ test_pick_circid(void *arg) /* CIRC_ID_TYPE_NEITHER is supposed to create a warning. */ chan1->circ_id_type = CIRC_ID_TYPE_NEITHER; - prev_level = setup_full_capture_of_logs(LOG_WARN); + setup_full_capture_of_logs(LOG_WARN); tt_int_op(0, OP_EQ, get_unique_circ_id_by_chan(chan1)); expect_single_log_msg_containing("Trying to pick a circuit ID for a " "connection from a client with no identity."); - teardown_capture_of_logs(prev_level); - prev_level = 0; + teardown_capture_of_logs(); /* Basic tests, with no collisions */ chan1->circ_id_type = CIRC_ID_TYPE_LOWER; @@ -365,8 +363,7 @@ test_pick_circid(void *arg) tor_free(chan2); bitarray_free(ba); circuit_free_all(); - if (prev_level) - teardown_capture_of_logs(prev_level); + teardown_capture_of_logs(); UNMOCK(channel_dump_statistics); } |