Check return value of evbuffer_add_cb in tests

Caught by clang's static analyzer
This commit is contained in:
Sebastian Hahn 2011-04-11 18:26:48 +02:00
parent 4bac793e3e
commit 93a1abb374

View File

@ -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);