mirror of
https://github.com/libevent/libevent.git
synced 2025-01-31 09:12:55 +08:00
Check return value of evbuffer_add_cb in tests
Caught by clang's static analyzer
This commit is contained in:
parent
4bac793e3e
commit
93a1abb374
@ -1140,7 +1140,9 @@ test_evbuffer_callbacks(void *ptr)
|
||||
evbuffer_drain(buf_out2, evbuffer_get_length(buf_out2));
|
||||
/* Let's test the obsolete buffer_setcb function too. */
|
||||
cb1 = evbuffer_add_cb(buf, log_change_callback, buf_out1);
|
||||
tt_assert(cb1 != NULL);
|
||||
cb2 = evbuffer_add_cb(buf, log_change_callback, buf_out2);
|
||||
tt_assert(cb2 != NULL);
|
||||
evbuffer_setcb(buf, self_draining_callback, NULL);
|
||||
evbuffer_add_printf(buf, "This should get drained right away.");
|
||||
tt_uint_op(evbuffer_get_length(buf), ==, 0);
|
||||
|
Loading…
x
Reference in New Issue
Block a user