mirror of
https://github.com/libevent/libevent.git
synced 2025-01-31 09:12:55 +08:00
Add a test to free_active_base to free a base with an active event.
svn:r1349
This commit is contained in:
parent
638116cacd
commit
d4e3671fb4
@ -943,10 +943,10 @@ test_free_active_base(void *ptr)
|
||||
{
|
||||
struct basic_test_data *data = ptr;
|
||||
struct event_base *base1;
|
||||
struct event ev1;
|
||||
|
||||
base1 = event_init();
|
||||
if (base1) {
|
||||
struct event ev1;
|
||||
event_assign(&ev1, base1, data->pair[1], EV_READ,
|
||||
dummy_read_cb, NULL);
|
||||
event_add(&ev1, NULL);
|
||||
@ -954,6 +954,14 @@ test_free_active_base(void *ptr)
|
||||
} else {
|
||||
tt_fail_msg("failed to create event_base for test");
|
||||
}
|
||||
|
||||
base1 = event_init();
|
||||
tt_assert(base1);
|
||||
event_assign(&ev1, base1, 0, 0, dummy_read_cb, NULL);
|
||||
event_active(&ev1, EV_READ, 1);
|
||||
event_base_free(base1);
|
||||
end:
|
||||
;
|
||||
}
|
||||
|
||||
static void
|
||||
|
Loading…
x
Reference in New Issue
Block a user