forked from cory/tildefriends
libuv 1.45.0, #include cleanup, probably something else.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4308 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
20
deps/libuv/test/test-ipc-send-recv.c
vendored
20
deps/libuv/test/test-ipc-send-recv.c
vendored
@@ -76,10 +76,12 @@ static int write2_cb_called;
|
||||
static void alloc_cb(uv_handle_t* handle,
|
||||
size_t suggested_size,
|
||||
uv_buf_t* buf) {
|
||||
/* we're not actually reading anything so a small buffer is okay */
|
||||
static char slab[8];
|
||||
buf->base = slab;
|
||||
buf->len = sizeof(slab);
|
||||
/* We're not actually reading anything so a small buffer is okay
|
||||
* but it needs to be heap-allocated to appease TSan.
|
||||
*/
|
||||
buf->len = 8;
|
||||
buf->base = malloc(buf->len);
|
||||
ASSERT_NOT_NULL(buf->base);
|
||||
}
|
||||
|
||||
|
||||
@@ -91,6 +93,8 @@ static void recv_cb(uv_stream_t* handle,
|
||||
int r;
|
||||
union handles* recv;
|
||||
|
||||
free(buf->base);
|
||||
|
||||
pipe = (uv_pipe_t*) handle;
|
||||
ASSERT(pipe == &ctx.channel);
|
||||
|
||||
@@ -219,7 +223,7 @@ static int run_ipc_send_recv_pipe(int inprocess) {
|
||||
r = run_test(inprocess);
|
||||
ASSERT(r == 0);
|
||||
|
||||
MAKE_VALGRIND_HAPPY();
|
||||
MAKE_VALGRIND_HAPPY(uv_default_loop());
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -260,7 +264,7 @@ static int run_ipc_send_recv_tcp(int inprocess) {
|
||||
r = run_test(inprocess);
|
||||
ASSERT(r == 0);
|
||||
|
||||
MAKE_VALGRIND_HAPPY();
|
||||
MAKE_VALGRIND_HAPPY(uv_default_loop());
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -304,6 +308,8 @@ static void read_cb(uv_stream_t* handle,
|
||||
union handles* recv;
|
||||
uv_write_t* write_req;
|
||||
|
||||
free(rdbuf->base);
|
||||
|
||||
if (nread == UV_EOF || nread == UV_ECONNABORTED) {
|
||||
return;
|
||||
}
|
||||
@@ -410,7 +416,7 @@ int ipc_send_recv_helper(void) {
|
||||
r = run_ipc_send_recv_helper(uv_default_loop(), 0);
|
||||
ASSERT(r == 0);
|
||||
|
||||
MAKE_VALGRIND_HAPPY();
|
||||
MAKE_VALGRIND_HAPPY(uv_default_loop());
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user