aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_address.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2016-09-08 15:01:32 -0400
committerNick Mathewson <nickm@torproject.org>2016-09-08 15:03:11 -0400
commitdeb294ff532d074a7d4094518c296fe69f819874 (patch)
tree3a49b6c30ab041807a025fa463ff57ca328165db /src/test/test_address.c
parentb0a9e54705d16d08ae7aff272492832dbb35646d (diff)
downloadtor-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_address.c')
-rw-r--r--src/test/test_address.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/test/test_address.c b/src/test/test_address.c
index 932dc38882..0be4c54bcf 100644
--- a/src/test/test_address.c
+++ b/src/test/test_address.c
@@ -795,7 +795,7 @@ test_address_get_if_addrs6_list_internal(void *arg)
(void)arg;
/* We might drop a log_err */
- int prev_level = setup_full_capture_of_logs(LOG_ERR);
+ setup_full_capture_of_logs(LOG_ERR);
results = get_interface_address6_list(LOG_ERR, AF_INET6, 1);
tt_int_op(smartlist_len(mock_saved_logs()), OP_LE, 1);
if (smartlist_len(mock_saved_logs()) == 1) {
@@ -803,7 +803,7 @@ test_address_get_if_addrs6_list_internal(void *arg)
"unable to create socket");
}
- teardown_capture_of_logs(prev_level);
+ teardown_capture_of_logs();
tt_assert(results != NULL);
/* Work even on systems without IPv6 interfaces */
@@ -822,6 +822,7 @@ test_address_get_if_addrs6_list_internal(void *arg)
done:
free_interface_address6_list(results);
+ teardown_capture_of_logs();
return;
}
@@ -833,7 +834,7 @@ test_address_get_if_addrs6_list_no_internal(void *arg)
(void)arg;
/* We might drop a log_err */
- int prev_level = setup_full_capture_of_logs(LOG_ERR);
+ setup_full_capture_of_logs(LOG_ERR);
results = get_interface_address6_list(LOG_ERR, AF_INET6, 0);
tt_int_op(smartlist_len(mock_saved_logs()), OP_LE, 1);
if (smartlist_len(mock_saved_logs()) == 1) {
@@ -841,7 +842,7 @@ test_address_get_if_addrs6_list_no_internal(void *arg)
"unable to create socket");
}
- teardown_capture_of_logs(prev_level);
+ teardown_capture_of_logs();
tt_assert(results != NULL);
/* Work even on systems without IPv6 interfaces */
@@ -859,6 +860,7 @@ test_address_get_if_addrs6_list_no_internal(void *arg)
}
done:
+ teardown_capture_of_logs();
free_interface_address6_list(results);
return;
}