test: check return value of write()/send() in bufferevent_read_failed

This will also suppress:

    ../test/regress_bufferevent.c: In function ‘test_bufferevent_read_failed’: 1102
    ../test/regress_bufferevent.c:1395:2: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result] 1103
      write(data->pair[0], buf, strlen(buf));
This commit is contained in:
Azat Khuzhin 2021-09-19 01:23:07 +03:00
parent 04fcd7c6df
commit f89e86123c

View File

@ -1390,9 +1390,9 @@ test_bufferevent_read_failed(void *arg)
tt_assert(bev != NULL);
#ifdef _WIN32
send(data->pair[0], buf, strlen(buf), 0);
tt_int_op(send(data->pair[0], buf, strlen(buf), 0), ==, strlen(buf));
#else
write(data->pair[0], buf, strlen(buf));
tt_int_op(write(data->pair[0], buf, strlen(buf)), ==, strlen(buf));
#endif
event_base_dispatch(data->base);