Add an assertion to tor_libevent_get_base()

Closes ticket 18241.
This commit is contained in:
Nick Mathewson 2016-02-04 12:37:00 -05:00
parent 5da517e689
commit c595f6d25e
2 changed files with 6 additions and 0 deletions

View File

@ -0,0 +1,5 @@
o Minor features (robustness):
- Exit immediately with an error message if the code attempts to
use libevent without having initialized it. This should resolve
some frequently-made mistakes in our unit tests. Closes ticket
18241.

View File

@ -247,6 +247,7 @@ tor_libevent_initialize(tor_libevent_cfg *torcfg)
MOCK_IMPL(struct event_base *, MOCK_IMPL(struct event_base *,
tor_libevent_get_base, (void)) tor_libevent_get_base, (void))
{ {
tor_assert(the_event_base != NULL);
return the_event_base; return the_event_base;
} }