Browse Source

deps: upgrade libuv to 4ba03dd

v0.9.7-release
Ben Noordhuis 12 years ago
parent
commit
952e42de72
  1. 8
      deps/uv/include/uv.h
  2. 7
      deps/uv/src/unix/core.c
  3. 41
      deps/uv/src/unix/stream.c
  4. 7
      deps/uv/src/win/core.c
  5. 2
      deps/uv/test/benchmark-async-pummel.c
  6. 4
      deps/uv/test/benchmark-async.c
  7. 4
      deps/uv/test/benchmark-fs-stat.c
  8. 2
      deps/uv/test/benchmark-getaddrinfo.c
  9. 4
      deps/uv/test/benchmark-loop-count.c
  10. 2
      deps/uv/test/benchmark-million-async.c
  11. 4
      deps/uv/test/benchmark-million-timers.c
  12. 10
      deps/uv/test/benchmark-multi-accept.c
  13. 2
      deps/uv/test/benchmark-ping-pongs.c
  14. 2
      deps/uv/test/benchmark-pound.c
  15. 8
      deps/uv/test/benchmark-pump.c
  16. 2
      deps/uv/test/benchmark-spawn.c
  17. 2
      deps/uv/test/benchmark-tcp-write-batch.c
  18. 2
      deps/uv/test/benchmark-udp-pummel.c
  19. 2
      deps/uv/test/blackhole-server.c
  20. 2
      deps/uv/test/dns-server.c
  21. 8
      deps/uv/test/echo-server.c
  22. 2
      deps/uv/test/test-active.c
  23. 2
      deps/uv/test/test-async.c
  24. 2
      deps/uv/test/test-callback-order.c
  25. 2
      deps/uv/test/test-callback-stack.c
  26. 2
      deps/uv/test/test-connection-fail.c
  27. 2
      deps/uv/test/test-delayed-accept.c
  28. 4
      deps/uv/test/test-embed.c
  29. 18
      deps/uv/test/test-fs-event.c
  30. 2
      deps/uv/test/test-fs-poll.c
  31. 76
      deps/uv/test/test-fs.c
  32. 4
      deps/uv/test/test-getaddrinfo.c
  33. 4
      deps/uv/test/test-getsockname.c
  34. 2
      deps/uv/test/test-idle.c
  35. 4
      deps/uv/test/test-ipc-send-recv.c
  36. 6
      deps/uv/test/test-ipc.c
  37. 2
      deps/uv/test/test-list.h
  38. 2
      deps/uv/test/test-loop-handles.c
  39. 2
      deps/uv/test/test-multiple-listen.c
  40. 6
      deps/uv/test/test-ping-pong.c
  41. 8
      deps/uv/test/test-pipe-bind-error.c
  42. 4
      deps/uv/test/test-pipe-connect-error.c
  43. 2
      deps/uv/test/test-poll-close.c
  44. 2
      deps/uv/test/test-poll.c
  45. 48
      deps/uv/test/test-ref.c
  46. 2
      deps/uv/test/test-run-nowait.c
  47. 2
      deps/uv/test/test-run-once.c
  48. 4
      deps/uv/test/test-shutdown-close.c
  49. 2
      deps/uv/test/test-shutdown-eof.c
  50. 8
      deps/uv/test/test-signal-multiple-loops.c
  51. 8
      deps/uv/test/test-signal.c
  52. 38
      deps/uv/test/test-spawn.c
  53. 6
      deps/uv/test/test-stdio-over-pipes.c
  54. 10
      deps/uv/test/test-tcp-bind-error.c
  55. 8
      deps/uv/test/test-tcp-bind6-error.c
  56. 2
      deps/uv/test/test-tcp-close-while-connecting.c
  57. 2
      deps/uv/test/test-tcp-close.c
  58. 2
      deps/uv/test/test-tcp-connect-error-after-write.c
  59. 2
      deps/uv/test/test-tcp-connect-error.c
  60. 2
      deps/uv/test/test-tcp-connect-timeout.c
  61. 2
      deps/uv/test/test-tcp-connect6-error.c
  62. 2
      deps/uv/test/test-tcp-flags.c
  63. 2
      deps/uv/test/test-tcp-open.c
  64. 2
      deps/uv/test/test-tcp-read-stop.c
  65. 2
      deps/uv/test/test-tcp-shutdown-after-write.c
  66. 2
      deps/uv/test/test-tcp-unexpected-read.c
  67. 169
      deps/uv/test/test-tcp-write-error.c
  68. 2
      deps/uv/test/test-tcp-write-to-half-open-connection.c
  69. 2
      deps/uv/test/test-tcp-writealot.c
  70. 2
      deps/uv/test/test-thread.c
  71. 10
      deps/uv/test/test-threadpool-cancel.c
  72. 4
      deps/uv/test/test-threadpool.c
  73. 2
      deps/uv/test/test-timer-again.c
  74. 4
      deps/uv/test/test-timer.c
  75. 2
      deps/uv/test/test-tty.c
  76. 2
      deps/uv/test/test-udp-dgram-too-big.c
  77. 2
      deps/uv/test/test-udp-ipv6.c
  78. 2
      deps/uv/test/test-udp-multicast-join.c
  79. 2
      deps/uv/test/test-udp-multicast-ttl.c
  80. 2
      deps/uv/test/test-udp-open.c
  81. 2
      deps/uv/test/test-udp-options.c
  82. 2
      deps/uv/test/test-udp-send-and-recv.c
  83. 2
      deps/uv/test/test-walk-handles.c
  84. 1
      deps/uv/uv.gyp
  85. 2
      src/node.cc

8
deps/uv/include/uv.h

@ -244,12 +244,6 @@ UV_EXTERN void uv_loop_delete(uv_loop_t*);
*/
UV_EXTERN uv_loop_t* uv_default_loop(void);
/*
* This function starts the event loop. It blocks until the reference count
* of the loop drops to zero. Always returns zero.
*/
UV_EXTERN int uv_run(uv_loop_t*);
/*
* This function runs the event loop. It will act differently depending on the
* specified mode:
@ -262,7 +256,7 @@ UV_EXTERN int uv_run(uv_loop_t*);
* - UV_RUN_NOWAIT: Poll for new events once but don't block if there are no
* pending events.
*/
UV_EXTERN int uv_run2(uv_loop_t*, uv_run_mode mode);
UV_EXTERN int uv_run(uv_loop_t*, uv_run_mode mode);
/*
* Manually modify the event loop's reference count. Useful if the user wants

7
deps/uv/src/unix/core.c

@ -279,7 +279,7 @@ static int uv__loop_alive(uv_loop_t* loop) {
}
int uv_run2(uv_loop_t* loop, uv_run_mode mode) {
int uv_run(uv_loop_t* loop, uv_run_mode mode) {
int r;
if (!uv__loop_alive(loop))
@ -301,11 +301,6 @@ int uv_run2(uv_loop_t* loop, uv_run_mode mode) {
}
int uv_run(uv_loop_t* loop) {
return uv_run2(loop, UV_RUN_DEFAULT);
}
void uv_update_time(uv_loop_t* loop) {
uv__update_time(loop);
}

41
deps/uv/src/unix/stream.c

@ -926,6 +926,14 @@ static void uv__read(uv_stream_t* stream) {
while (nread < 0 && errno == EINTR);
}
#define INVOKE_READ_CB(stream, status, buf, type) \
do { \
if ((stream)->read_cb != NULL) \
(stream)->read_cb((stream), (status), (buf)); \
else \
(stream)->read2_cb((uv_pipe_t*) (stream), (status), (buf), (type)); \
} \
while (0)
if (nread < 0) {
/* Error */
@ -935,41 +943,22 @@ static void uv__read(uv_stream_t* stream) {
uv__io_start(stream->loop, &stream->io_watcher, UV__POLLIN);
}
uv__set_sys_error(stream->loop, EAGAIN);
if (stream->read_cb) {
stream->read_cb(stream, 0, buf);
} else {
stream->read2_cb((uv_pipe_t*)stream, 0, buf, UV_UNKNOWN_HANDLE);
}
return;
INVOKE_READ_CB(stream, 0, buf, UV_UNKNOWN_HANDLE);
} else {
/* Error. User should call uv_close(). */
uv__set_sys_error(stream->loop, errno);
if (stream->read_cb) {
stream->read_cb(stream, -1, buf);
} else {
stream->read2_cb((uv_pipe_t*)stream, -1, buf, UV_UNKNOWN_HANDLE);
}
assert(!uv__io_active(&stream->io_watcher, UV__POLLIN));
return;
INVOKE_READ_CB(stream, -1, buf, UV_UNKNOWN_HANDLE);
assert(!uv__io_active(&stream->io_watcher, UV__POLLIN) &&
"stream->read_cb(status=-1) did not call uv_close()");
}
return;
} else if (nread == 0) {
/* EOF */
uv__set_artificial_error(stream->loop, UV_EOF);
uv__io_stop(stream->loop, &stream->io_watcher, UV__POLLIN);
if (!uv__io_active(&stream->io_watcher, UV__POLLOUT))
uv__handle_stop(stream);
if (stream->read_cb) {
stream->read_cb(stream, -1, buf);
} else {
stream->read2_cb((uv_pipe_t*)stream, -1, buf, UV_UNKNOWN_HANDLE);
}
uv__set_artificial_error(stream->loop, UV_EOF);
INVOKE_READ_CB(stream, -1, buf, UV_UNKNOWN_HANDLE);
return;
} else {
/* Successful read */

7
deps/uv/src/win/core.c

@ -252,7 +252,7 @@ static void uv_poll_ex(uv_loop_t* loop, int block) {
!ngx_queue_empty(&(loop)->active_reqs) || \
(loop)->endgame_handles != NULL)
int uv_run2(uv_loop_t *loop, uv_run_mode mode) {
int uv_run(uv_loop_t *loop, uv_run_mode mode) {
int r;
void (*poll)(uv_loop_t* loop, int block);
@ -291,8 +291,3 @@ int uv_run2(uv_loop_t *loop, uv_run_mode mode) {
}
return r;
}
int uv_run(uv_loop_t* loop) {
return uv_run2(loop, UV_RUN_DEFAULT);
}

2
deps/uv/test/benchmark-async-pummel.c

@ -78,7 +78,7 @@ static int test_async_pummel(int nthreads) {
time = uv_hrtime();
ASSERT(0 == uv_run(uv_default_loop()));
ASSERT(0 == uv_run(uv_default_loop(), UV_RUN_DEFAULT));
time = uv_hrtime() - time;
done = 1;

4
deps/uv/test/benchmark-async.c

@ -67,7 +67,7 @@ static void main_async_cb(uv_async_t* handle, int status) {
static void worker(void* arg) {
struct ctx* ctx = arg;
ASSERT(0 == uv_async_send(&ctx->main_async));
ASSERT(0 == uv_run(ctx->loop));
ASSERT(0 == uv_run(ctx->loop, UV_RUN_DEFAULT));
}
@ -92,7 +92,7 @@ static int test_async(int nthreads) {
time = uv_hrtime();
ASSERT(0 == uv_run(uv_default_loop()));
ASSERT(0 == uv_run(uv_default_loop(), UV_RUN_DEFAULT));
for (i = 0; i < nthreads; i++)
ASSERT(0 == uv_thread_join(&threads[i].thread));

4
deps/uv/test/benchmark-fs-stat.c

@ -51,7 +51,7 @@ static void warmup(const char* path) {
for (i = 0; i < ARRAY_SIZE(reqs); i++)
uv_fs_stat(uv_default_loop(), reqs + i, path, uv_fs_req_cleanup);
uv_run(uv_default_loop());
uv_run(uv_default_loop(), UV_RUN_DEFAULT);
/* warm up the OS dirent cache */
for (i = 0; i < 16; i++)
@ -108,7 +108,7 @@ static void async_bench(const char* path) {
}
before = uv_hrtime();
uv_run(uv_default_loop());
uv_run(uv_default_loop(), UV_RUN_DEFAULT);
after = uv_hrtime();
printf("%s stats (%d concurrent): %.2fs (%s/s)\n",

2
deps/uv/test/benchmark-getaddrinfo.c

@ -75,7 +75,7 @@ BENCHMARK_IMPL(getaddrinfo) {
getaddrinfo_initiate(&handles[i]);
}
uv_run(loop);
uv_run(loop, UV_RUN_DEFAULT);
uv_update_time(loop);
end_time = uv_now(loop);

4
deps/uv/test/benchmark-loop-count.c

@ -57,7 +57,7 @@ BENCHMARK_IMPL(loop_count) {
uv_idle_start(&idle_handle, idle_cb);
ns = uv_hrtime();
uv_run(loop);
uv_run(loop, UV_RUN_DEFAULT);
ns = uv_hrtime() - ns;
ASSERT(ticks == NUM_TICKS);
@ -81,7 +81,7 @@ BENCHMARK_IMPL(loop_count_timed) {
uv_timer_init(loop, &timer_handle);
uv_timer_start(&timer_handle, timer_cb, 5000, 0);
uv_run(loop);
uv_run(loop, UV_RUN_DEFAULT);
LOGF("loop_count: %lu ticks (%.0f ticks/s)\n", ticks, ticks / 5.0);

2
deps/uv/test/benchmark-million-async.c

@ -99,7 +99,7 @@ BENCHMARK_IMPL(million_async) {
ASSERT(0 == uv_timer_init(loop, &timer_handle));
ASSERT(0 == uv_timer_start(&timer_handle, timer_cb, timeout, 0));
ASSERT(0 == uv_thread_create(&thread_id, thread_cb, NULL));
ASSERT(0 == uv_run(loop));
ASSERT(0 == uv_run(loop, UV_RUN_DEFAULT));
printf("%s async events in %.1f seconds (%s/s, %s unique handles seen)\n",
fmt(container->async_events),
timeout / 1000.,

4
deps/uv/test/benchmark-million-timers.c

@ -59,13 +59,13 @@ BENCHMARK_IMPL(million_timers) {
}
before = uv_hrtime();
ASSERT(0 == uv_run(loop));
ASSERT(0 == uv_run(loop, UV_RUN_DEFAULT));
after = uv_hrtime();
for (i = 0; i < NUM_TIMERS; i++)
uv_close((uv_handle_t*) (timers + i), close_cb);
ASSERT(0 == uv_run(loop));
ASSERT(0 == uv_run(loop, UV_RUN_DEFAULT));
ASSERT(timer_cb_called == NUM_TIMERS);
ASSERT(close_cb_called == NUM_TIMERS);
free(timers);

10
deps/uv/test/benchmark-multi-accept.c

@ -214,9 +214,9 @@ static void send_listen_handles(uv_handle_type type,
for (i = 0; i < num_servers; i++)
uv_sem_post(&servers[i].semaphore);
ASSERT(0 == uv_run(loop));
ASSERT(0 == uv_run(loop, UV_RUN_DEFAULT));
uv_close((uv_handle_t*) &ctx.server_handle, NULL);
ASSERT(0 == uv_run(loop));
ASSERT(0 == uv_run(loop, UV_RUN_DEFAULT));
for (i = 0; i < num_servers; i++)
uv_sem_wait(&servers[i].semaphore);
@ -234,7 +234,7 @@ static void get_listen_handle(uv_loop_t* loop, uv_stream_t* server_handle) {
&ctx.ipc_pipe,
IPC_PIPE_NAME,
ipc_connect_cb);
ASSERT(0 == uv_run(loop));
ASSERT(0 == uv_run(loop, UV_RUN_DEFAULT));
}
@ -258,7 +258,7 @@ static void server_cb(void *arg) {
ASSERT(0 == uv_listen((uv_stream_t*) &ctx->server_handle,
128,
sv_connection_cb));
ASSERT(0 == uv_run(loop));
ASSERT(0 == uv_run(loop, UV_RUN_DEFAULT));
uv_loop_delete(loop);
}
@ -383,7 +383,7 @@ static int test_tcp(unsigned int num_servers, unsigned int num_clients) {
{
uint64_t t = uv_hrtime();
ASSERT(0 == uv_run(loop));
ASSERT(0 == uv_run(loop, UV_RUN_DEFAULT));
t = uv_hrtime() - t;
time = t / 1e9;
}

2
deps/uv/test/benchmark-ping-pongs.c

@ -203,7 +203,7 @@ BENCHMARK_IMPL(ping_pongs) {
start_time = uv_now(loop);
pinger_new();
uv_run(loop);
uv_run(loop, UV_RUN_DEFAULT);
ASSERT(completed_pingers == 1);

2
deps/uv/test/benchmark-pound.c

@ -287,7 +287,7 @@ static int pound_it(int concurrency,
r = do_connect(concurrency, make_connect, arg);
ASSERT(!r);
uv_run(loop);
uv_run(loop, UV_RUN_DEFAULT);
end_time = uv_hrtime();

8
deps/uv/test/benchmark-pump.c

@ -373,7 +373,7 @@ HELPER_IMPL(tcp_pump_server) {
r = uv_listen((uv_stream_t*)&tcpServer, MAX_WRITE_HANDLES, connection_cb);
ASSERT(r == 0);
uv_run(loop);
uv_run(loop, UV_RUN_DEFAULT);
return 0;
}
@ -394,7 +394,7 @@ HELPER_IMPL(pipe_pump_server) {
r = uv_listen((uv_stream_t*)&pipeServer, MAX_WRITE_HANDLES, connection_cb);
ASSERT(r == 0);
uv_run(loop);
uv_run(loop, UV_RUN_DEFAULT);
MAKE_VALGRIND_HAPPY();
return 0;
@ -413,7 +413,7 @@ static void tcp_pump(int n) {
/* Start making connections */
maybe_connect_some();
uv_run(loop);
uv_run(loop, UV_RUN_DEFAULT);
MAKE_VALGRIND_HAPPY();
}
@ -429,7 +429,7 @@ static void pipe_pump(int n) {
/* Start making connections */
maybe_connect_some();
uv_run(loop);
uv_run(loop, UV_RUN_DEFAULT);
MAKE_VALGRIND_HAPPY();
}

2
deps/uv/test/benchmark-spawn.c

@ -149,7 +149,7 @@ BENCHMARK_IMPL(spawn) {
spawn();
r = uv_run(loop);
r = uv_run(loop, UV_RUN_DEFAULT);
ASSERT(r == 0);
uv_update_time(loop);

2
deps/uv/test/benchmark-tcp-write-batch.c

@ -122,7 +122,7 @@ BENCHMARK_IMPL(tcp_write_batch) {
start = uv_hrtime();
r = uv_run(loop);
r = uv_run(loop, UV_RUN_DEFAULT);
ASSERT(r == 0);
stop = uv_hrtime();

2
deps/uv/test/benchmark-udp-pummel.c

@ -195,7 +195,7 @@ static int pummel(unsigned int n_senders,
}
duration = uv_hrtime();
ASSERT(0 == uv_run(loop));
ASSERT(0 == uv_run(loop, UV_RUN_DEFAULT));
duration = uv_hrtime() - duration;
/* convert from nanoseconds to milliseconds */
duration = duration / (uint64_t) 1e6;

2
deps/uv/test/blackhole-server.c

@ -111,7 +111,7 @@ HELPER_IMPL(tcp4_blackhole_server) {
r = uv_listen((uv_stream_t*)&tcp_server, 128, connection_cb);
ASSERT(r == 0);
r = uv_run(loop);
r = uv_run(loop, UV_RUN_DEFAULT);
ASSERT(0 && "Blackhole server dropped out of event loop.");
return 0;

2
deps/uv/test/dns-server.c

@ -324,6 +324,6 @@ HELPER_IMPL(dns_server) {
if (dns_start(TEST_PORT_2))
return 1;
uv_run(loop);
uv_run(loop, UV_RUN_DEFAULT);
return 0;
}

8
deps/uv/test/echo-server.c

@ -346,7 +346,7 @@ HELPER_IMPL(tcp4_echo_server) {
if (tcp4_echo_start(TEST_PORT))
return 1;
uv_run(loop);
uv_run(loop, UV_RUN_DEFAULT);
return 0;
}
@ -357,7 +357,7 @@ HELPER_IMPL(tcp6_echo_server) {
if (tcp6_echo_start(TEST_PORT))
return 1;
uv_run(loop);
uv_run(loop, UV_RUN_DEFAULT);
return 0;
}
@ -368,7 +368,7 @@ HELPER_IMPL(pipe_echo_server) {
if (pipe_echo_start(TEST_PIPENAME))
return 1;
uv_run(loop);
uv_run(loop, UV_RUN_DEFAULT);
return 0;
}
@ -379,6 +379,6 @@ HELPER_IMPL(udp4_echo_server) {
if (udp4_echo_start(TEST_PORT))
return 1;
uv_run(loop);
uv_run(loop, UV_RUN_DEFAULT);
return 0;
}

2
deps/uv/test/test-active.c

@ -73,7 +73,7 @@ TEST_IMPL(active) {
ASSERT(!uv_is_active((uv_handle_t*) &timer));
ASSERT(uv_is_closing((uv_handle_t*) &timer));
r = uv_run(uv_default_loop());
r = uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(r == 0);
ASSERT(close_cb_called == 1);

2
deps/uv/test/test-async.c

@ -122,7 +122,7 @@ TEST_IMPL(async) {
r = uv_async_init(uv_default_loop(), &async, async_cb);
ASSERT(r == 0);
r = uv_run(uv_default_loop());
r = uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(r == 0);
ASSERT(prepare_cb_called > 0);

2
deps/uv/test/test-callback-order.c

@ -67,7 +67,7 @@ TEST_IMPL(callback_order) {
ASSERT(idle_cb_called == 0);
ASSERT(timer_cb_called == 0);
uv_run(loop);
uv_run(loop, UV_RUN_DEFAULT);
ASSERT(idle_cb_called == 1);
ASSERT(timer_cb_called == 1);

2
deps/uv/test/test-callback-stack.c

@ -189,7 +189,7 @@ TEST_IMPL(callback_stack) {
}
nested--;
uv_run(uv_default_loop());
uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(nested == 0);
ASSERT(connect_cb_called == 1 && "connect_cb must be called exactly once");

2
deps/uv/test/test-connection-fail.c

@ -107,7 +107,7 @@ static void connection_fail(uv_connect_cb connect_cb) {
r = uv_tcp_connect(&req, &tcp, server_addr, connect_cb);
ASSERT(!r);
uv_run(uv_default_loop());
uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(connect_cb_calls == 1);
ASSERT(close_cb_calls == 1);

2
deps/uv/test/test-delayed-accept.c

@ -177,7 +177,7 @@ TEST_IMPL(delayed_accept) {
client_connect();
client_connect();
uv_run(uv_default_loop());
uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(connection_cb_called == 2);
ASSERT(do_accept_called == 2);

4
deps/uv/test/test-embed.c

@ -88,7 +88,7 @@ static void embed_thread_runner(void* arg) {
static void embed_cb(uv_async_t* async, int status) {
uv_run2(uv_default_loop(), UV_RUN_ONCE);
uv_run(uv_default_loop(), UV_RUN_ONCE);
uv_sem_post(&embed_sem);
}
@ -124,7 +124,7 @@ TEST_IMPL(embed) {
uv_thread_create(&embed_thread, embed_thread_runner, NULL);
/* But run external loop */
uv_run(external);
uv_run(external, UV_RUN_DEFAULT);
uv_thread_join(&embed_thread);
uv_loop_delete(external);

18
deps/uv/test/test-fs-event.c

@ -194,7 +194,7 @@ TEST_IMPL(fs_event_watch_dir) {
r = uv_timer_start(&timer, timer_cb_dir, 100, 0);
ASSERT(r != -1);
uv_run(loop);
uv_run(loop, UV_RUN_DEFAULT);
ASSERT(fs_event_cb_called == 1);
ASSERT(timer_cb_called == 1);
@ -228,7 +228,7 @@ TEST_IMPL(fs_event_watch_file) {
r = uv_timer_start(&timer, timer_cb_file, 100, 100);
ASSERT(r != -1);
uv_run(loop);
uv_run(loop, UV_RUN_DEFAULT);
ASSERT(fs_event_cb_called == 1);
ASSERT(timer_cb_called == 2);
@ -256,7 +256,7 @@ TEST_IMPL(fs_event_watch_file_twice) {
ASSERT(0 == uv_fs_event_init(loop, watchers + 1, path, fail_cb, 0));
ASSERT(0 == uv_timer_init(loop, &timer));
ASSERT(0 == uv_timer_start(&timer, timer_cb_watch_twice, 10, 0));
ASSERT(0 == uv_run(loop));
ASSERT(0 == uv_run(loop, UV_RUN_DEFAULT));
MAKE_VALGRIND_HAPPY();
return 0;
@ -287,7 +287,7 @@ TEST_IMPL(fs_event_watch_file_current_dir) {
ASSERT(fs_event_cb_called == 0);
ASSERT(close_cb_called == 0);
uv_run(loop);
uv_run(loop, UV_RUN_DEFAULT);
ASSERT(timer_cb_touch_called == 1);
ASSERT(fs_event_cb_called == 1);
@ -319,7 +319,7 @@ TEST_IMPL(fs_event_no_callback_after_close) {
uv_close((uv_handle_t*)&fs_event, close_cb);
touch_file(loop, "watch_dir/file1");
uv_run(loop);
uv_run(loop, UV_RUN_DEFAULT);
ASSERT(fs_event_cb_called == 0);
ASSERT(close_cb_called == 1);
@ -351,7 +351,7 @@ TEST_IMPL(fs_event_no_callback_on_close) {
uv_close((uv_handle_t*)&fs_event, close_cb);
uv_run(loop);
uv_run(loop, UV_RUN_DEFAULT);
ASSERT(fs_event_cb_called == 0);
ASSERT(close_cb_called == 1);
@ -397,7 +397,7 @@ TEST_IMPL(fs_event_immediate_close) {
r = uv_timer_start(&timer, timer_cb, 1, 0);
ASSERT(r == 0);
uv_run(loop);
uv_run(loop, UV_RUN_DEFAULT);
ASSERT(close_cb_called == 2);
@ -423,7 +423,7 @@ TEST_IMPL(fs_event_close_with_pending_event) {
uv_close((uv_handle_t*)&fs_event, close_cb);
uv_run(loop);
uv_run(loop, UV_RUN_DEFAULT);
ASSERT(close_cb_called == 1);
@ -484,7 +484,7 @@ TEST_IMPL(fs_event_close_in_callback) {
touch_file(loop, "watch_dir/file4");
touch_file(loop, "watch_dir/file5");
uv_run(loop);
uv_run(loop, UV_RUN_DEFAULT);
ASSERT(close_cb_called == 1);
ASSERT(fs_event_cb_called == 3);

2
deps/uv/test/test-fs-poll.c

@ -137,7 +137,7 @@ TEST_IMPL(fs_poll) {
ASSERT(0 == uv_timer_init(loop, &timer_handle));
ASSERT(0 == uv_fs_poll_init(loop, &poll_handle));
ASSERT(0 == uv_fs_poll_start(&poll_handle, poll_cb, FIXTURE, 100));
ASSERT(0 == uv_run(loop));
ASSERT(0 == uv_run(loop, UV_RUN_DEFAULT));
ASSERT(poll_cb_called == 5);
ASSERT(timer_cb_called == 2);

76
deps/uv/test/test-fs.c

@ -477,7 +477,7 @@ TEST_IMPL(fs_file_noent) {
ASSERT(r == 0);
ASSERT(open_cb_count == 0);
uv_run(loop);
uv_run(loop, UV_RUN_DEFAULT);
ASSERT(open_cb_count == 1);
/* TODO add EACCES test */
@ -506,7 +506,7 @@ TEST_IMPL(fs_file_nametoolong) {
ASSERT(r == 0);
ASSERT(open_cb_count == 0);
uv_run(loop);
uv_run(loop, UV_RUN_DEFAULT);
ASSERT(open_cb_count == 1);
MAKE_VALGRIND_HAPPY();
@ -533,7 +533,7 @@ TEST_IMPL(fs_file_loop) {
ASSERT(r == 0);
ASSERT(open_cb_count == 0);
uv_run(loop);
uv_run(loop, UV_RUN_DEFAULT);
ASSERT(open_cb_count == 1);
unlink("test_symlink");
@ -610,7 +610,7 @@ TEST_IMPL(fs_file_async) {
r = uv_fs_open(loop, &open_req1, "test_file", O_WRONLY | O_CREAT,
S_IREAD | S_IWRITE, create_cb);
ASSERT(r == 0);
uv_run(loop);
uv_run(loop, UV_RUN_DEFAULT);
ASSERT(create_cb_count == 1);
ASSERT(write_cb_count == 1);
@ -621,7 +621,7 @@ TEST_IMPL(fs_file_async) {
r = uv_fs_rename(loop, &rename_req, "test_file", "test_file2", rename_cb);
ASSERT(r == 0);
uv_run(loop);
uv_run(loop, UV_RUN_DEFAULT);
ASSERT(create_cb_count == 1);
ASSERT(write_cb_count == 1);
ASSERT(close_cb_count == 1);
@ -630,7 +630,7 @@ TEST_IMPL(fs_file_async) {
r = uv_fs_open(loop, &open_req1, "test_file2", O_RDWR, 0, open_cb);
ASSERT(r == 0);
uv_run(loop);
uv_run(loop, UV_RUN_DEFAULT);
ASSERT(open_cb_count == 1);
ASSERT(read_cb_count == 1);
ASSERT(close_cb_count == 2);
@ -642,7 +642,7 @@ TEST_IMPL(fs_file_async) {
r = uv_fs_open(loop, &open_req1, "test_file2", O_RDONLY, 0, open_cb);
ASSERT(r == 0);
uv_run(loop);
uv_run(loop, UV_RUN_DEFAULT);
ASSERT(open_cb_count == 2);
ASSERT(read_cb_count == 2);
ASSERT(close_cb_count == 3);
@ -759,7 +759,7 @@ TEST_IMPL(fs_async_dir) {
r = uv_fs_mkdir(loop, &mkdir_req, "test_dir", 0755, mkdir_cb);
ASSERT(r == 0);
uv_run(loop);
uv_run(loop, UV_RUN_DEFAULT);
ASSERT(mkdir_cb_count == 1);
/* Create 2 files synchronously. */
@ -782,7 +782,7 @@ TEST_IMPL(fs_async_dir) {
r = uv_fs_readdir(loop, &readdir_req, "test_dir", 0, readdir_cb);
ASSERT(r == 0);
uv_run(loop);
uv_run(loop, UV_RUN_DEFAULT);
ASSERT(readdir_cb_count == 1);
/* sync uv_fs_readdir */
@ -797,35 +797,35 @@ TEST_IMPL(fs_async_dir) {
r = uv_fs_stat(loop, &stat_req, "test_dir", stat_cb);
ASSERT(r == 0);
uv_run(loop);
uv_run(loop, UV_RUN_DEFAULT);
r = uv_fs_stat(loop, &stat_req, "test_dir/", stat_cb);
ASSERT(r == 0);
uv_run(loop);
uv_run(loop, UV_RUN_DEFAULT);
r = uv_fs_lstat(loop, &stat_req, "test_dir", stat_cb);
ASSERT(r == 0);
uv_run(loop);
uv_run(loop, UV_RUN_DEFAULT);
r = uv_fs_lstat(loop, &stat_req, "test_dir/", stat_cb);
ASSERT(r == 0);
uv_run(loop);
uv_run(loop, UV_RUN_DEFAULT);
ASSERT(stat_cb_count == 4);
r = uv_fs_unlink(loop, &unlink_req, "test_dir/file1", unlink_cb);
ASSERT(r == 0);
uv_run(loop);
uv_run(loop, UV_RUN_DEFAULT);
ASSERT(unlink_cb_count == 1);
r = uv_fs_unlink(loop, &unlink_req, "test_dir/file2", unlink_cb);
ASSERT(r == 0);
uv_run(loop);
uv_run(loop, UV_RUN_DEFAULT);
ASSERT(unlink_cb_count == 2);
r = uv_fs_rmdir(loop, &rmdir_req, "test_dir", rmdir_cb);
ASSERT(r == 0);
uv_run(loop);
uv_run(loop, UV_RUN_DEFAULT);
ASSERT(rmdir_cb_count == 1);
/* Cleanup */
@ -878,7 +878,7 @@ TEST_IMPL(fs_async_sendfile) {
r = uv_fs_sendfile(loop, &sendfile_req, open_req2.result, open_req1.result,
0, 131072, sendfile_cb);
ASSERT(r == 0);
uv_run(loop);
uv_run(loop, UV_RUN_DEFAULT);
ASSERT(sendfile_cb_count == 1);
@ -935,7 +935,7 @@ TEST_IMPL(fs_fstat) {
/* Now do the uv_fs_fstat call asynchronously */
r = uv_fs_fstat(loop, &req, file, fstat_cb);
ASSERT(r == 0);
uv_run(loop);
uv_run(loop, UV_RUN_DEFAULT);
ASSERT(fstat_cb_count == 1);
@ -948,7 +948,7 @@ TEST_IMPL(fs_fstat) {
* Run the loop just to check we don't have make any extraneous uv_ref()
* calls. This should drop out immediately.
*/
uv_run(loop);
uv_run(loop, UV_RUN_DEFAULT);
/* Cleanup. */
unlink("test_file");
@ -1014,7 +1014,7 @@ TEST_IMPL(fs_chmod) {
}
r = uv_fs_chmod(loop, &req, "test_file", 0200, chmod_cb);
ASSERT(r == 0);
uv_run(loop);
uv_run(loop, UV_RUN_DEFAULT);
ASSERT(chmod_cb_count == 1);
chmod_cb_count = 0; /* reset for the next test */
#endif
@ -1026,7 +1026,7 @@ TEST_IMPL(fs_chmod) {
}
r = uv_fs_chmod(loop, &req, "test_file", 0400, chmod_cb);
ASSERT(r == 0);
uv_run(loop);
uv_run(loop, UV_RUN_DEFAULT);
ASSERT(chmod_cb_count == 1);
/* async fchmod */
@ -1036,7 +1036,7 @@ TEST_IMPL(fs_chmod) {
}
r = uv_fs_fchmod(loop, &req, file, 0600, fchmod_cb);
ASSERT(r == 0);
uv_run(loop);
uv_run(loop, UV_RUN_DEFAULT);
ASSERT(fchmod_cb_count == 1);
close(file);
@ -1045,7 +1045,7 @@ TEST_IMPL(fs_chmod) {
* Run the loop just to check we don't have make any extraneous uv_ref()
* calls. This should drop out immediately.
*/
uv_run(loop);
uv_run(loop, UV_RUN_DEFAULT);
/* Cleanup. */
unlink("test_file");
@ -1087,19 +1087,19 @@ TEST_IMPL(fs_chown) {
/* async chown */
r = uv_fs_chown(loop, &req, "test_file", -1, -1, chown_cb);
ASSERT(r == 0);
uv_run(loop);
uv_run(loop, UV_RUN_DEFAULT);
ASSERT(chown_cb_count == 1);
/* chown to root (fail) */
chown_cb_count = 0;
r = uv_fs_chown(loop, &req, "test_file", 0, 0, chown_root_cb);
uv_run(loop);
uv_run(loop, UV_RUN_DEFAULT);
ASSERT(chown_cb_count == 1);
/* async fchown */
r = uv_fs_fchown(loop, &req, file, -1, -1, fchown_cb);
ASSERT(r == 0);
uv_run(loop);
uv_run(loop, UV_RUN_DEFAULT);
ASSERT(fchown_cb_count == 1);
close(file);
@ -1108,7 +1108,7 @@ TEST_IMPL(fs_chown) {
* Run the loop just to check we don't have make any extraneous uv_ref()
* calls. This should drop out immediately.
*/
uv_run(loop);
uv_run(loop, UV_RUN_DEFAULT);
/* Cleanup. */
unlink("test_file");
@ -1168,7 +1168,7 @@ TEST_IMPL(fs_link) {
/* async link */
r = uv_fs_link(loop, &req, "test_file", "test_file_link2", link_cb);
ASSERT(r == 0);
uv_run(loop);
uv_run(loop, UV_RUN_DEFAULT);
ASSERT(link_cb_count == 1);
r = uv_fs_open(loop, &req, "test_file_link2", O_RDWR, 0, NULL);
@ -1189,7 +1189,7 @@ TEST_IMPL(fs_link) {
* Run the loop just to check we don't have make any extraneous uv_ref()
* calls. This should drop out immediately.
*/
uv_run(loop);
uv_run(loop, UV_RUN_DEFAULT);
/* Cleanup. */
unlink("test_file");
@ -1206,7 +1206,7 @@ TEST_IMPL(fs_readlink) {
loop = uv_default_loop();
ASSERT(0 == uv_fs_readlink(loop, &req, "no_such_file", dummy_cb));
ASSERT(0 == uv_run(loop));
ASSERT(0 == uv_run(loop, UV_RUN_DEFAULT));
ASSERT(dummy_cb_count == 1);
ASSERT(req.ptr == NULL);
ASSERT(req.result == -1);
@ -1302,7 +1302,7 @@ TEST_IMPL(fs_symlink) {
/* async link */
r = uv_fs_symlink(loop, &req, "test_file", "test_file_symlink2", 0, symlink_cb);
ASSERT(r == 0);
uv_run(loop);
uv_run(loop, UV_RUN_DEFAULT);
ASSERT(symlink_cb_count == 1);
r = uv_fs_open(loop, &req, "test_file_symlink2", O_RDWR, 0, NULL);
@ -1325,14 +1325,14 @@ TEST_IMPL(fs_symlink) {
r = uv_fs_readlink(loop, &req, "test_file_symlink2_symlink", readlink_cb);
ASSERT(r != -1);
uv_run(loop);
uv_run(loop, UV_RUN_DEFAULT);
ASSERT(readlink_cb_count == 1);
/*
* Run the loop just to check we don't have make any extraneous uv_ref()
* calls. This should drop out immediately.
*/
uv_run(loop);
uv_run(loop, UV_RUN_DEFAULT);
/* Cleanup. */
unlink("test_file");
@ -1498,7 +1498,7 @@ TEST_IMPL(fs_utime) {
utime_req.data = &checkme;
r = uv_fs_utime(loop, &utime_req, path, atime, mtime, utime_cb);
ASSERT(r == 0);
uv_run(loop);
uv_run(loop, UV_RUN_DEFAULT);
ASSERT(utime_cb_count == 1);
/* Cleanup. */
@ -1590,7 +1590,7 @@ TEST_IMPL(fs_futime) {
futime_req.data = &checkme;
r = uv_fs_futime(loop, &futime_req, file, atime, mtime, futime_cb);
ASSERT(r == 0);
uv_run(loop);
uv_run(loop, UV_RUN_DEFAULT);
ASSERT(futime_cb_count == 1);
/* Cleanup. */
@ -1639,7 +1639,7 @@ TEST_IMPL(fs_readdir_empty_dir) {
ASSERT(r == 0);
ASSERT(readdir_cb_count == 0);
uv_run(loop);
uv_run(loop, UV_RUN_DEFAULT);
ASSERT(readdir_cb_count == 1);
uv_fs_rmdir(loop, &req, path, NULL);
@ -1666,7 +1666,7 @@ TEST_IMPL(fs_readdir_file) {
ASSERT(r == 0);
ASSERT(readdir_cb_count == 0);
uv_run(loop);
uv_run(loop, UV_RUN_DEFAULT);
ASSERT(readdir_cb_count == 1);
MAKE_VALGRIND_HAPPY();
@ -1696,7 +1696,7 @@ TEST_IMPL(fs_open_dir) {
ASSERT(r == 0);
ASSERT(open_cb_count == 0);
uv_run(loop);
uv_run(loop, UV_RUN_DEFAULT);
ASSERT(open_cb_count == 1);
MAKE_VALGRIND_HAPPY();

4
deps/uv/test/test-getaddrinfo.c

@ -80,7 +80,7 @@ TEST_IMPL(getaddrinfo_basic) {
NULL);
ASSERT(r == 0);
uv_run(uv_default_loop());
uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(getaddrinfo_cbs == 1);
@ -109,7 +109,7 @@ TEST_IMPL(getaddrinfo_concurrent) {
ASSERT(r == 0);
}
uv_run(uv_default_loop());
uv_run(uv_default_loop(), UV_RUN_DEFAULT);
for (i = 0; i < CONCURRENT_COUNT; i++) {
ASSERT(callback_counts[i] == 1);

4
deps/uv/test/test-getsockname.c

@ -317,7 +317,7 @@ TEST_IMPL(getsockname_tcp) {
tcp_connector();
uv_run(loop);
uv_run(loop, UV_RUN_DEFAULT);
ASSERT(getsocknamecount == 3);
ASSERT(getpeernamecount == 3);
@ -335,7 +335,7 @@ TEST_IMPL(getsockname_udp) {
udp_sender();
uv_run(loop);
uv_run(loop, UV_RUN_DEFAULT);
ASSERT(getsocknamecount == 2);

2
deps/uv/test/test-idle.c

@ -70,7 +70,7 @@ TEST_IMPL(idle_starvation) {
r = uv_timer_start(&timer_handle, timer_cb, 50, 0);
ASSERT(r == 0);
r = uv_run(uv_default_loop());
r = uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(r == 0);
ASSERT(idle_cb_called > 0);

4
deps/uv/test/test-ipc-send-recv.c

@ -103,7 +103,7 @@ static int run_test(void) {
r = uv_read2_start((uv_stream_t*)&ctx.channel, alloc_cb, recv_cb);
ASSERT(r == 0);
r = uv_run(uv_default_loop());
r = uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(r == 0);
ASSERT(num_recv_handles == 1);
@ -210,7 +210,7 @@ int ipc_send_recv_helper(void) {
r = uv_read2_start((uv_stream_t*)&ctx.channel, alloc_cb, read2_cb);
ASSERT(r == 0);
r = uv_run(uv_default_loop());
r = uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(r == 0);
MAKE_VALGRIND_HAPPY();

6
deps/uv/test/test-ipc.c

@ -318,7 +318,7 @@ static int run_ipc_test(const char* helper, uv_read2_cb read_cb) {
spawn_helper(&channel, &process, helper);
uv_read2_start((uv_stream_t*)&channel, on_alloc, read_cb);
r = uv_run(uv_default_loop());
r = uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(r == 0);
MAKE_VALGRIND_HAPPY();
@ -567,7 +567,7 @@ int ipc_helper(int listen_after_write) {
ASSERT(r == 0);
}
r = uv_run(uv_default_loop());
r = uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(r == 0);
ASSERT(connection_accepted == 1);
@ -613,7 +613,7 @@ int ipc_helper_tcp_connection(void) {
r = uv_tcp_connect(&conn.conn_req, (uv_tcp_t*)&conn.conn, addr, connect_child_process_cb);
ASSERT(r == 0);
r = uv_run(uv_default_loop());
r = uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(r == 0);
ASSERT(tcp_conn_read_cb_called == 1);

2
deps/uv/test/test-list.h

@ -64,7 +64,6 @@ TEST_DECLARE (tcp_connect_timeout)
TEST_DECLARE (tcp_close_while_connecting)
TEST_DECLARE (tcp_close)
TEST_DECLARE (tcp_flags)
TEST_DECLARE (tcp_write_error)
TEST_DECLARE (tcp_write_to_half_open_connection)
TEST_DECLARE (tcp_unexpected_read)
TEST_DECLARE (tcp_read_stop)
@ -288,7 +287,6 @@ TASK_LIST_START
TEST_ENTRY (tcp_close_while_connecting)
TEST_ENTRY (tcp_close)
TEST_ENTRY (tcp_flags)
TEST_ENTRY (tcp_write_error)
TEST_ENTRY (tcp_write_to_half_open_connection)
TEST_ENTRY (tcp_unexpected_read)

2
deps/uv/test/test-loop-handles.c

@ -312,7 +312,7 @@ TEST_IMPL(loop_handles) {
ASSERT(r == 0);
uv_unref((uv_handle_t*)&timer_handle);
r = uv_run(uv_default_loop());
r = uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(r == 0);
ASSERT(loop_iteration == ITERATIONS);

2
deps/uv/test/test-multiple-listen.c

@ -92,7 +92,7 @@ TEST_IMPL(multiple_listen) {
client_connect();
uv_run(uv_default_loop());
uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(connection_cb_called == 1);
ASSERT(connect_cb_called == 1);

6
deps/uv/test/test-ping-pong.c

@ -219,7 +219,7 @@ static void pipe_pinger_new(void) {
TEST_IMPL(tcp_ping_pong) {
tcp_pinger_new();
uv_run(uv_default_loop());
uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(completed_pingers == 1);
@ -230,7 +230,7 @@ TEST_IMPL(tcp_ping_pong) {
TEST_IMPL(tcp_ping_pong_v6) {
tcp_pinger_v6_new();
uv_run(uv_default_loop());
uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(completed_pingers == 1);
@ -241,7 +241,7 @@ TEST_IMPL(tcp_ping_pong_v6) {
TEST_IMPL(pipe_ping_pong) {
pipe_pinger_new();
uv_run(uv_default_loop());
uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(completed_pingers == 1);

8
deps/uv/test/test-pipe-bind-error.c

@ -67,7 +67,7 @@ TEST_IMPL(pipe_bind_error_addrinuse) {
uv_close((uv_handle_t*)&server1, close_cb);
uv_close((uv_handle_t*)&server2, close_cb);
uv_run(uv_default_loop());
uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(close_cb_called == 2);
@ -89,7 +89,7 @@ TEST_IMPL(pipe_bind_error_addrnotavail) {
uv_close((uv_handle_t*)&server, close_cb);
uv_run(uv_default_loop());
uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(close_cb_called == 1);
@ -113,7 +113,7 @@ TEST_IMPL(pipe_bind_error_inval) {
uv_close((uv_handle_t*)&server, close_cb);
uv_run(uv_default_loop());
uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(close_cb_called == 1);
@ -135,7 +135,7 @@ TEST_IMPL(pipe_listen_without_bind) {
uv_close((uv_handle_t*)&server, close_cb);
uv_run(uv_default_loop());
uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(close_cb_called == 1);

4
deps/uv/test/test-pipe-connect-error.c

@ -68,7 +68,7 @@ TEST_IMPL(pipe_connect_bad_name) {
ASSERT(r == 0);
uv_pipe_connect(&req, &client, BAD_PIPENAME, connect_cb);
uv_run(uv_default_loop());
uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(close_cb_called == 1);
ASSERT(connect_cb_called == 1);
@ -88,7 +88,7 @@ TEST_IMPL(pipe_connect_to_file) {
ASSERT(r == 0);
uv_pipe_connect(&req, &client, path, connect_cb_file);
uv_run(uv_default_loop());
uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(close_cb_called == 1);
ASSERT(connect_cb_called == 1);

2
deps/uv/test/test-poll-close.c

@ -64,7 +64,7 @@ TEST_IMPL(poll_close) {
uv_close((uv_handle_t*) &poll_handles[i], close_cb);
}
uv_run(uv_default_loop());
uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(close_cb_called == NUM_SOCKETS);

2
deps/uv/test/test-poll.c

@ -547,7 +547,7 @@ static void start_poll_test(void) {
for (i = 0; i < NUM_CLIENTS; i++)
start_client();
r = uv_run(uv_default_loop());
r = uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(r == 0);
/* Assert that at most five percent of the writable wakeups was spurious. */

48
deps/uv/test/test-ref.c

@ -48,7 +48,7 @@ static void do_close(void* handle) {
close_cb_called = 0;
uv_close((uv_handle_t*)handle, close_cb);
ASSERT(close_cb_called == 0);
uv_run(uv_default_loop());
uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(close_cb_called == 1);
}
@ -100,7 +100,7 @@ static void connect_and_shutdown(uv_connect_t* req, int status) {
TEST_IMPL(ref) {
uv_run(uv_default_loop());
uv_run(uv_default_loop(), UV_RUN_DEFAULT);
MAKE_VALGRIND_HAPPY();
return 0;
}
@ -111,7 +111,7 @@ TEST_IMPL(idle_ref) {
uv_idle_init(uv_default_loop(), &h);
uv_idle_start(&h, (uv_idle_cb) fail_cb2);
uv_unref((uv_handle_t*)&h);
uv_run(uv_default_loop());
uv_run(uv_default_loop(), UV_RUN_DEFAULT);
do_close(&h);
MAKE_VALGRIND_HAPPY();
return 0;
@ -122,7 +122,7 @@ TEST_IMPL(async_ref) {
uv_async_t h;
uv_async_init(uv_default_loop(), &h, NULL);
uv_unref((uv_handle_t*)&h);
uv_run(uv_default_loop());
uv_run(uv_default_loop(), UV_RUN_DEFAULT);
do_close(&h);
MAKE_VALGRIND_HAPPY();
return 0;
@ -134,7 +134,7 @@ TEST_IMPL(prepare_ref) {
uv_prepare_init(uv_default_loop(), &h);
uv_prepare_start(&h, (uv_prepare_cb) fail_cb2);
uv_unref((uv_handle_t*)&h);
uv_run(uv_default_loop());
uv_run(uv_default_loop(), UV_RUN_DEFAULT);
do_close(&h);
MAKE_VALGRIND_HAPPY();
return 0;
@ -146,7 +146,7 @@ TEST_IMPL(check_ref) {
uv_check_init(uv_default_loop(), &h);
uv_check_start(&h, (uv_check_cb) fail_cb2);
uv_unref((uv_handle_t*)&h);
uv_run(uv_default_loop());
uv_run(uv_default_loop(), UV_RUN_DEFAULT);
do_close(&h);
MAKE_VALGRIND_HAPPY();
return 0;
@ -164,7 +164,7 @@ TEST_IMPL(unref_in_prepare_cb) {
uv_prepare_t h;
uv_prepare_init(uv_default_loop(), &h);
uv_prepare_start(&h, prepare_cb);
uv_run(uv_default_loop());
uv_run(uv_default_loop(), UV_RUN_DEFAULT);
do_close(&h);
MAKE_VALGRIND_HAPPY();
return 0;
@ -175,7 +175,7 @@ TEST_IMPL(timer_ref) {
uv_timer_t h;
uv_timer_init(uv_default_loop(), &h);
uv_unref((uv_handle_t*)&h);
uv_run(uv_default_loop());
uv_run(uv_default_loop(), UV_RUN_DEFAULT);
do_close(&h);
MAKE_VALGRIND_HAPPY();
return 0;
@ -187,7 +187,7 @@ TEST_IMPL(timer_ref2) {
uv_timer_init(uv_default_loop(), &h);
uv_timer_start(&h, (uv_timer_cb)fail_cb, 42, 42);
uv_unref((uv_handle_t*)&h);
uv_run(uv_default_loop());
uv_run(uv_default_loop(), UV_RUN_DEFAULT);
do_close(&h);
MAKE_VALGRIND_HAPPY();
return 0;
@ -198,7 +198,7 @@ TEST_IMPL(fs_event_ref) {
uv_fs_event_t h;
uv_fs_event_init(uv_default_loop(), &h, ".", (uv_fs_event_cb)fail_cb, 0);
uv_unref((uv_handle_t*)&h);
uv_run(uv_default_loop());
uv_run(uv_default_loop(), UV_RUN_DEFAULT);
do_close(&h);
MAKE_VALGRIND_HAPPY();
return 0;
@ -210,7 +210,7 @@ TEST_IMPL(fs_poll_ref) {
uv_fs_poll_init(uv_default_loop(), &h);
uv_fs_poll_start(&h, NULL, ".", 999);
uv_unref((uv_handle_t*)&h);
uv_run(uv_default_loop());
uv_run(uv_default_loop(), UV_RUN_DEFAULT);
do_close(&h);
MAKE_VALGRIND_HAPPY();
return 0;
@ -221,7 +221,7 @@ TEST_IMPL(tcp_ref) {
uv_tcp_t h;
uv_tcp_init(uv_default_loop(), &h);
uv_unref((uv_handle_t*)&h);
uv_run(uv_default_loop());
uv_run(uv_default_loop(), UV_RUN_DEFAULT);
do_close(&h);
MAKE_VALGRIND_HAPPY();
return 0;
@ -233,7 +233,7 @@ TEST_IMPL(tcp_ref2) {
uv_tcp_init(uv_default_loop(), &h);
uv_listen((uv_stream_t*)&h, 128, (uv_connection_cb)fail_cb);
uv_unref((uv_handle_t*)&h);
uv_run(uv_default_loop());
uv_run(uv_default_loop(), UV_RUN_DEFAULT);
do_close(&h);
MAKE_VALGRIND_HAPPY();
return 0;
@ -246,7 +246,7 @@ TEST_IMPL(tcp_ref2b) {
uv_listen((uv_stream_t*)&h, 128, (uv_connection_cb)fail_cb);
uv_unref((uv_handle_t*)&h);
uv_close((uv_handle_t*)&h, close_cb);
uv_run(uv_default_loop());
uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(close_cb_called == 1);
MAKE_VALGRIND_HAPPY();
return 0;
@ -259,7 +259,7 @@ TEST_IMPL(tcp_ref3) {
uv_tcp_init(uv_default_loop(), &h);
uv_tcp_connect(&connect_req, &h, addr, connect_and_shutdown);
uv_unref((uv_handle_t*)&h);
uv_run(uv_default_loop());
uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(connect_cb_called == 1);
ASSERT(shutdown_cb_called == 1);
do_close(&h);
@ -274,7 +274,7 @@ TEST_IMPL(tcp_ref4) {
uv_tcp_init(uv_default_loop(), &h);
uv_tcp_connect(&connect_req, &h, addr, connect_and_write);
uv_unref((uv_handle_t*)&h);
uv_run(uv_default_loop());
uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(connect_cb_called == 1);
ASSERT(write_cb_called == 1);
ASSERT(shutdown_cb_called == 1);
@ -288,7 +288,7 @@ TEST_IMPL(udp_ref) {
uv_udp_t h;
uv_udp_init(uv_default_loop(), &h);
uv_unref((uv_handle_t*)&h);
uv_run(uv_default_loop());
uv_run(uv_default_loop(), UV_RUN_DEFAULT);
do_close(&h);
MAKE_VALGRIND_HAPPY();
return 0;
@ -302,7 +302,7 @@ TEST_IMPL(udp_ref2) {
uv_udp_bind(&h, addr, 0);
uv_udp_recv_start(&h, (uv_alloc_cb)fail_cb, (uv_udp_recv_cb)fail_cb);
uv_unref((uv_handle_t*)&h);
uv_run(uv_default_loop());
uv_run(uv_default_loop(), UV_RUN_DEFAULT);
do_close(&h);
MAKE_VALGRIND_HAPPY();
return 0;
@ -318,7 +318,7 @@ TEST_IMPL(udp_ref3) {
uv_udp_init(uv_default_loop(), &h);
uv_udp_send(&req, &h, &buf, 1, addr, (uv_udp_send_cb)req_cb);
uv_unref((uv_handle_t*)&h);
uv_run(uv_default_loop());
uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(req_cb_called == 1);
do_close(&h);
@ -331,7 +331,7 @@ TEST_IMPL(pipe_ref) {
uv_pipe_t h;
uv_pipe_init(uv_default_loop(), &h, 0);
uv_unref((uv_handle_t*)&h);
uv_run(uv_default_loop());
uv_run(uv_default_loop(), UV_RUN_DEFAULT);
do_close(&h);
MAKE_VALGRIND_HAPPY();
return 0;
@ -343,7 +343,7 @@ TEST_IMPL(pipe_ref2) {
uv_pipe_init(uv_default_loop(), &h, 0);
uv_listen((uv_stream_t*)&h, 128, (uv_connection_cb)fail_cb);
uv_unref((uv_handle_t*)&h);
uv_run(uv_default_loop());
uv_run(uv_default_loop(), UV_RUN_DEFAULT);
do_close(&h);
MAKE_VALGRIND_HAPPY();
return 0;
@ -355,7 +355,7 @@ TEST_IMPL(pipe_ref3) {
uv_pipe_init(uv_default_loop(), &h, 0);
uv_pipe_connect(&connect_req, &h, TEST_PIPENAME, connect_and_shutdown);
uv_unref((uv_handle_t*)&h);
uv_run(uv_default_loop());
uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(connect_cb_called == 1);
ASSERT(shutdown_cb_called == 1);
do_close(&h);
@ -369,7 +369,7 @@ TEST_IMPL(pipe_ref4) {
uv_pipe_init(uv_default_loop(), &h, 0);
uv_pipe_connect(&connect_req, &h, TEST_PIPENAME, connect_and_write);
uv_unref((uv_handle_t*)&h);
uv_run(uv_default_loop());
uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(connect_cb_called == 1);
ASSERT(write_cb_called == 1);
ASSERT(shutdown_cb_called == 1);
@ -403,7 +403,7 @@ TEST_IMPL(process_ref) {
ASSERT(r == 0);
uv_unref((uv_handle_t*)&h);
uv_run(uv_default_loop());
uv_run(uv_default_loop(), UV_RUN_DEFAULT);
r = uv_process_kill(&h, /* SIGTERM */ 15);
ASSERT(r == 0);

2
deps/uv/test/test-run-nowait.c

@ -38,7 +38,7 @@ TEST_IMPL(run_nowait) {
uv_timer_init(uv_default_loop(), &timer_handle);
uv_timer_start(&timer_handle, timer_cb, 100, 100);
r = uv_run2(uv_default_loop(), UV_RUN_NOWAIT);
r = uv_run(uv_default_loop(), UV_RUN_NOWAIT);
ASSERT(r != 0);
ASSERT(timer_called == 0);

2
deps/uv/test/test-run-once.c

@ -41,7 +41,7 @@ TEST_IMPL(run_once) {
uv_idle_init(uv_default_loop(), &idle_handle);
uv_idle_start(&idle_handle, idle_cb);
while (uv_run2(uv_default_loop(), UV_RUN_ONCE));
while (uv_run(uv_default_loop(), UV_RUN_ONCE));
ASSERT(idle_counter == NUM_TICKS);
MAKE_VALGRIND_HAPPY();

4
deps/uv/test/test-shutdown-close.c

@ -74,7 +74,7 @@ TEST_IMPL(shutdown_close_tcp) {
ASSERT(r == 0);
r = uv_tcp_connect(&connect_req, &h, addr, connect_cb);
ASSERT(r == 0);
r = uv_run(uv_default_loop());
r = uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(r == 0);
ASSERT(connect_cb_called == 1);
@ -93,7 +93,7 @@ TEST_IMPL(shutdown_close_pipe) {
r = uv_pipe_init(uv_default_loop(), &h, 0);
ASSERT(r == 0);
uv_pipe_connect(&connect_req, &h, TEST_PIPENAME, connect_cb);
r = uv_run(uv_default_loop());
r = uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(r == 0);
ASSERT(connect_cb_called == 1);

2
deps/uv/test/test-shutdown-eof.c

@ -168,7 +168,7 @@ TEST_IMPL(shutdown_eof) {
r = uv_tcp_connect(&connect_req, &tcp, server_addr, connect_cb);
ASSERT(!r);
uv_run(uv_default_loop());
uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(called_connect_cb == 1);
ASSERT(called_shutdown_cb == 1);

8
deps/uv/test/test-signal-multiple-loops.c

@ -104,7 +104,7 @@ static void signal_handling_worker(void* context) {
/* Wait for all signals. The signal callbacks stop the watcher, so uv_run
* will return when all signal watchers caught a signal.
*/
r = uv_run(loop);
r = uv_run(loop, UV_RUN_DEFAULT);
ASSERT(r == 0);
/* Restart the signal watchers. */
@ -122,7 +122,7 @@ static void signal_handling_worker(void* context) {
/* Wait for signals once more. */
uv_sem_post(&sem);
r = uv_run(loop);
r = uv_run(loop, UV_RUN_DEFAULT);
ASSERT(r == 0);
/* Close the watchers. */
@ -135,7 +135,7 @@ static void signal_handling_worker(void* context) {
}
/* Wait for the signal watchers to close. */
r = uv_run(loop);
r = uv_run(loop, UV_RUN_DEFAULT);
ASSERT(r == 0);
uv_loop_delete(loop);
@ -166,7 +166,7 @@ static void loop_creating_worker(void* context) {
uv_close((uv_handle_t*) &signal, NULL);
r = uv_run(loop);
r = uv_run(loop, UV_RUN_DEFAULT);
ASSERT(r == 0);
uv_loop_delete(loop);

8
deps/uv/test/test-signal.c

@ -101,12 +101,12 @@ TEST_IMPL(we_get_signal) {
start_timer(loop, SIGCHLD, &tc);
start_watcher(loop, SIGCHLD, &sc);
sc.stop_or_close = STOP; /* stop, don't close the signal handle */
ASSERT(0 == uv_run(loop));
ASSERT(0 == uv_run(loop, UV_RUN_DEFAULT));
ASSERT(tc.ncalls == NSIGNALS);
ASSERT(sc.ncalls == NSIGNALS);
start_timer(loop, SIGCHLD, &tc);
ASSERT(0 == uv_run(loop));
ASSERT(0 == uv_run(loop, UV_RUN_DEFAULT));
ASSERT(tc.ncalls == NSIGNALS);
ASSERT(sc.ncalls == NSIGNALS);
@ -115,7 +115,7 @@ TEST_IMPL(we_get_signal) {
uv_signal_start(&sc.handle, signal_cb, SIGCHLD);
start_timer(loop, SIGCHLD, &tc);
ASSERT(0 == uv_run(loop));
ASSERT(0 == uv_run(loop, UV_RUN_DEFAULT));
ASSERT(tc.ncalls == NSIGNALS);
ASSERT(sc.ncalls == NSIGNALS);
@ -137,7 +137,7 @@ TEST_IMPL(we_get_signals) {
start_watcher(loop, SIGUSR2, sc + 3);
start_timer(loop, SIGUSR1, tc + 0);
start_timer(loop, SIGUSR2, tc + 1);
ASSERT(0 == uv_run(loop));
ASSERT(0 == uv_run(loop, UV_RUN_DEFAULT));
for (i = 0; i < ARRAY_SIZE(sc); i++)
ASSERT(sc[i].ncalls == NSIGNALS);

38
deps/uv/test/test-spawn.c

@ -150,7 +150,7 @@ TEST_IMPL(spawn_fails) {
options.file = options.args[0] = "program-that-had-better-not-exist";
ASSERT(0 == uv_spawn(uv_default_loop(), &process, options));
ASSERT(0 != uv_is_active((uv_handle_t*)&process));
ASSERT(0 == uv_run(uv_default_loop()));
ASSERT(0 == uv_run(uv_default_loop(), UV_RUN_DEFAULT));
ASSERT(uv_last_error(uv_default_loop()).code == UV_ENOENT);
MAKE_VALGRIND_HAPPY();
@ -166,7 +166,7 @@ TEST_IMPL(spawn_exit_code) {
r = uv_spawn(uv_default_loop(), &process, options);
ASSERT(r == 0);
r = uv_run(uv_default_loop());
r = uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(r == 0);
ASSERT(exit_cb_called == 1);
@ -197,7 +197,7 @@ TEST_IMPL(spawn_stdout) {
r = uv_read_start((uv_stream_t*) &out, on_alloc, on_read);
ASSERT(r == 0);
r = uv_run(uv_default_loop());
r = uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(r == 0);
ASSERT(exit_cb_called == 1);
@ -237,7 +237,7 @@ TEST_IMPL(spawn_stdout_to_file) {
r = uv_spawn(uv_default_loop(), &process, options);
ASSERT(r == 0);
r = uv_run(uv_default_loop());
r = uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(r == 0);
ASSERT(exit_cb_called == 1);
@ -294,7 +294,7 @@ TEST_IMPL(spawn_stdin) {
r = uv_read_start((uv_stream_t*) &out, on_alloc, on_read);
ASSERT(r == 0);
r = uv_run(uv_default_loop());
r = uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(r == 0);
ASSERT(exit_cb_called == 1);
@ -328,7 +328,7 @@ TEST_IMPL(spawn_stdio_greater_than_3) {
r = uv_read_start((uv_stream_t*) &pipe, on_alloc, on_read);
ASSERT(r == 0);
r = uv_run(uv_default_loop());
r = uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(r == 0);
ASSERT(exit_cb_called == 1);
@ -352,7 +352,7 @@ TEST_IMPL(spawn_ignored_stdio) {
r = uv_spawn(uv_default_loop(), &process, options);
ASSERT(r == 0);
r = uv_run(uv_default_loop());
r = uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(r == 0);
ASSERT(exit_cb_called == 1);
@ -377,7 +377,7 @@ TEST_IMPL(spawn_and_kill) {
r = uv_timer_start(&timer, timer_cb, 500, 0);
ASSERT(r == 0);
r = uv_run(uv_default_loop());
r = uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(r == 0);
ASSERT(exit_cb_called == 1);
@ -414,7 +414,7 @@ TEST_IMPL(spawn_preserve_env) {
r = uv_read_start((uv_stream_t*) &out, on_alloc, on_read);
ASSERT(r == 0);
r = uv_run(uv_default_loop());
r = uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(r == 0);
ASSERT(exit_cb_called == 1);
@ -441,7 +441,7 @@ TEST_IMPL(spawn_detached) {
uv_unref((uv_handle_t*)&process);
r = uv_run(uv_default_loop());
r = uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(r == 0);
ASSERT(exit_cb_called == 0);
@ -504,7 +504,7 @@ TEST_IMPL(spawn_and_kill_with_std) {
r = uv_timer_start(&timer, timer_cb, 500, 0);
ASSERT(r == 0);
r = uv_run(uv_default_loop());
r = uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(r == 0);
ASSERT(exit_cb_called == 1);
@ -551,7 +551,7 @@ TEST_IMPL(spawn_and_ping) {
ASSERT(exit_cb_called == 0);
r = uv_run(uv_default_loop());
r = uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(r == 0);
ASSERT(exit_cb_called == 1);
@ -585,7 +585,7 @@ TEST_IMPL(kill) {
err = uv_kill(process.pid, /* SIGTERM */ 15);
ASSERT(err.code == UV_OK);
r = uv_run(uv_default_loop());
r = uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(r == 0);
ASSERT(exit_cb_called == 1);
@ -631,7 +631,7 @@ TEST_IMPL(spawn_detect_pipe_name_collisions_on_windows) {
r = uv_read_start((uv_stream_t*) &out, on_alloc, on_read);
ASSERT(r == 0);
r = uv_run(uv_default_loop());
r = uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(r == 0);
ASSERT(exit_cb_called == 1);
@ -793,7 +793,7 @@ TEST_IMPL(spawn_setuid_setgid) {
r = uv_spawn(uv_default_loop(), &process, options);
ASSERT(r == 0);
r = uv_run(uv_default_loop());
r = uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(r == 0);
ASSERT(exit_cb_called == 1);
@ -827,7 +827,7 @@ TEST_IMPL(spawn_setuid_fails) {
r = uv_spawn(uv_default_loop(), &process, options);
ASSERT(r == 0);
r = uv_run(uv_default_loop());
r = uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(r == 0);
ASSERT(exit_cb_called == 1);
@ -859,7 +859,7 @@ TEST_IMPL(spawn_setgid_fails) {
r = uv_spawn(uv_default_loop(), &process, options);
ASSERT(r == 0);
r = uv_run(uv_default_loop());
r = uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(r == 0);
ASSERT(exit_cb_called == 1);
@ -892,7 +892,7 @@ TEST_IMPL(spawn_setuid_fails) {
ASSERT(r == -1);
ASSERT(uv_last_error(uv_default_loop()).code == UV_ENOTSUP);
r = uv_run(uv_default_loop());
r = uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(r == 0);
ASSERT(close_cb_called == 0);
@ -914,7 +914,7 @@ TEST_IMPL(spawn_setgid_fails) {
ASSERT(r == -1);
ASSERT(uv_last_error(uv_default_loop()).code == UV_ENOTSUP);
r = uv_run(uv_default_loop());
r = uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(r == 0);
ASSERT(close_cb_called == 0);

6
deps/uv/test/test-stdio-over-pipes.c

@ -138,7 +138,7 @@ TEST_IMPL(stdio_over_pipes) {
r = uv_read_start((uv_stream_t*) &out, on_alloc, on_read);
ASSERT(r == 0);
r = uv_run(uv_default_loop());
r = uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(r == 0);
ASSERT(on_read_cb_called > 1);
@ -226,7 +226,7 @@ int stdio_over_pipes_helper(void) {
ASSERT(r == 0);
}
uv_run(loop);
uv_run(loop, UV_RUN_DEFAULT);
ASSERT(after_write_called == 7);
ASSERT(on_pipe_read_called == 0);
@ -239,7 +239,7 @@ int stdio_over_pipes_helper(void) {
on_pipe_read);
ASSERT(r == 0);
uv_run(loop);
uv_run(loop, UV_RUN_DEFAULT);
ASSERT(after_write_called == 7);
ASSERT(on_pipe_read_called == 1);

10
deps/uv/test/test-tcp-bind-error.c

@ -59,7 +59,7 @@ TEST_IMPL(tcp_bind_error_addrinuse) {
uv_close((uv_handle_t*)&server1, close_cb);
uv_close((uv_handle_t*)&server2, close_cb);
uv_run(uv_default_loop());
uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(close_cb_called == 2);
@ -84,7 +84,7 @@ TEST_IMPL(tcp_bind_error_addrnotavail_1) {
uv_close((uv_handle_t*)&server, close_cb);
uv_run(uv_default_loop());
uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(close_cb_called == 1);
@ -106,7 +106,7 @@ TEST_IMPL(tcp_bind_error_addrnotavail_2) {
uv_close((uv_handle_t*)&server, close_cb);
uv_run(uv_default_loop());
uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(close_cb_called == 1);
@ -132,7 +132,7 @@ TEST_IMPL(tcp_bind_error_fault) {
uv_close((uv_handle_t*)&server, close_cb);
uv_run(uv_default_loop());
uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(close_cb_called == 1);
@ -159,7 +159,7 @@ TEST_IMPL(tcp_bind_error_inval) {
uv_close((uv_handle_t*)&server, close_cb);
uv_run(uv_default_loop());
uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(close_cb_called == 1);

8
deps/uv/test/test-tcp-bind6-error.c

@ -59,7 +59,7 @@ TEST_IMPL(tcp_bind6_error_addrinuse) {
uv_close((uv_handle_t*)&server1, close_cb);
uv_close((uv_handle_t*)&server2, close_cb);
uv_run(uv_default_loop());
uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(close_cb_called == 2);
@ -81,7 +81,7 @@ TEST_IMPL(tcp_bind6_error_addrnotavail) {
uv_close((uv_handle_t*)&server, close_cb);
uv_run(uv_default_loop());
uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(close_cb_called == 1);
@ -107,7 +107,7 @@ TEST_IMPL(tcp_bind6_error_fault) {
uv_close((uv_handle_t*)&server, close_cb);
uv_run(uv_default_loop());
uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(close_cb_called == 1);
@ -134,7 +134,7 @@ TEST_IMPL(tcp_bind6_error_inval) {
uv_close((uv_handle_t*)&server, close_cb);
uv_run(uv_default_loop());
uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(close_cb_called == 1);

2
deps/uv/test/test-tcp-close-while-connecting.c

@ -70,7 +70,7 @@ TEST_IMPL(tcp_close_while_connecting) {
ASSERT(0 == uv_timer_start(&timer1_handle, timer1_cb, 50, 0));
ASSERT(0 == uv_timer_init(loop, &timer2_handle));
ASSERT(0 == uv_timer_start(&timer2_handle, timer2_cb, 86400 * 1000, 0));
ASSERT(0 == uv_run(loop));
ASSERT(0 == uv_run(loop, UV_RUN_DEFAULT));
ASSERT(connect_cb_called == 1);
ASSERT(timer1_cb_called == 1);

2
deps/uv/test/test-tcp-close.c

@ -117,7 +117,7 @@ TEST_IMPL(tcp_close) {
ASSERT(write_cb_called == 0);
ASSERT(close_cb_called == 0);
r = uv_run(loop);
r = uv_run(loop, UV_RUN_DEFAULT);
ASSERT(r == 0);
printf("%d of %d write reqs seen\n", write_cb_called, NUM_WRITE_REQS);

2
deps/uv/test/test-tcp-connect-error-after-write.c

@ -84,7 +84,7 @@ TEST_IMPL(tcp_connect_error_after_write) {
r = uv_write(&write_req, (uv_stream_t*)&conn, &buf, 1, write_cb);
ASSERT(r == 0);
r = uv_run(uv_default_loop());
r = uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(r == 0);
ASSERT(connect_cb_called == 1);

2
deps/uv/test/test-tcp-connect-error.c

@ -61,7 +61,7 @@ TEST_IMPL(tcp_connect_error_fault) {
uv_close((uv_handle_t*)&server, close_cb);
uv_run(uv_default_loop());
uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(connect_cb_called == 0);
ASSERT(close_cb_called == 1);

2
deps/uv/test/test-tcp-connect-timeout.c

@ -78,7 +78,7 @@ TEST_IMPL(tcp_connect_timeout) {
r = uv_tcp_connect(&connect_req, &conn, addr, connect_cb);
ASSERT(r == 0);
r = uv_run(uv_default_loop());
r = uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(r == 0);
MAKE_VALGRIND_HAPPY();

2
deps/uv/test/test-tcp-connect6-error.c

@ -59,7 +59,7 @@ TEST_IMPL(tcp_connect6_error_fault) {
uv_close((uv_handle_t*)&server, close_cb);
uv_run(uv_default_loop());
uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(connect_cb_called == 0);
ASSERT(close_cb_called == 1);

2
deps/uv/test/test-tcp-flags.c

@ -44,7 +44,7 @@ TEST_IMPL(tcp_flags) {
uv_close((uv_handle_t*)&handle, NULL);
r = uv_run(loop);
r = uv_run(loop, UV_RUN_DEFAULT);
ASSERT(r == 0);
MAKE_VALGRIND_HAPPY();

2
deps/uv/test/test-tcp-open.c

@ -163,7 +163,7 @@ TEST_IMPL(tcp_open) {
r = uv_tcp_connect(&connect_req, &client, addr, connect_cb);
ASSERT(r == 0);
uv_run(uv_default_loop());
uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(shutdown_cb_called == 1);
ASSERT(connect_cb_called == 1);

2
deps/uv/test/test-tcp-read-stop.c

@ -66,7 +66,7 @@ TEST_IMPL(tcp_read_stop) {
ASSERT(0 == uv_timer_init(uv_default_loop(), &timer_handle));
ASSERT(0 == uv_tcp_init(uv_default_loop(), &tcp_handle));
ASSERT(0 == uv_tcp_connect(&connect_req, &tcp_handle, addr, connect_cb));
ASSERT(0 == uv_run(uv_default_loop()));
ASSERT(0 == uv_run(uv_default_loop(), UV_RUN_DEFAULT));
MAKE_VALGRIND_HAPPY();
return 0;

2
deps/uv/test/test-tcp-shutdown-after-write.c

@ -118,7 +118,7 @@ TEST_IMPL(tcp_shutdown_after_write) {
r = uv_tcp_connect(&connect_req, &conn, addr, connect_cb);
ASSERT(r == 0);
r = uv_run(loop);
r = uv_run(loop, UV_RUN_DEFAULT);
ASSERT(r == 0);
ASSERT(connect_cb_called == 1);

2
deps/uv/test/test-tcp-unexpected-read.c

@ -101,7 +101,7 @@ TEST_IMPL(tcp_unexpected_read) {
ASSERT(0 == uv_tcp_bind(&server_handle, addr));
ASSERT(0 == uv_listen((uv_stream_t*) &server_handle, 1, connection_cb));
ASSERT(0 == uv_tcp_connect(&connect_req, &client_handle, addr, connect_cb));
ASSERT(0 == uv_run(loop));
ASSERT(0 == uv_run(loop, UV_RUN_DEFAULT));
/* This is somewhat inexact but the idea is that the event loop should not
* start busy looping when the server sends a message and the client isn't

169
deps/uv/test/test-tcp-write-error.c

@ -1,169 +0,0 @@
/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*/
#include "uv.h"
#include "task.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
static void connection_cb(uv_stream_t* server, int status);
static void connect_cb(uv_connect_t* req, int status);
static void write_cb(uv_write_t* req, int status);
static void read_cb(uv_stream_t* stream, ssize_t nread, uv_buf_t buf);
static uv_buf_t alloc_cb(uv_handle_t* handle, size_t suggested_size);
static uv_tcp_t tcp_server;
static uv_tcp_t tcp_client;
static uv_tcp_t tcp_peer; /* client socket as accept()-ed by server */
static uv_connect_t connect_req;
static int write_cb_called;
static int write_cb_error_called;
typedef struct {
uv_write_t req;
uv_buf_t buf;
} write_req_t;
static void connection_cb(uv_stream_t* server, int status) {
int r;
ASSERT(server == (uv_stream_t*)&tcp_server);
ASSERT(status == 0);
r = uv_tcp_init(server->loop, &tcp_peer);
ASSERT(r == 0);
r = uv_accept(server, (uv_stream_t*)&tcp_peer);
ASSERT(r == 0);
r = uv_read_start((uv_stream_t*)&tcp_peer, alloc_cb, read_cb);
ASSERT(r == 0);
}
static uv_buf_t alloc_cb(uv_handle_t* handle, size_t suggested_size) {
static char slab[1024];
return uv_buf_init(slab, sizeof slab);
}
static void read_cb(uv_stream_t* stream, ssize_t nread, uv_buf_t buf) {
uv_close((uv_handle_t*)&tcp_server, NULL);
uv_close((uv_handle_t*)&tcp_peer, NULL);
}
static void connect_cb(uv_connect_t* req, int status) {
uv_buf_t buf;
size_t size;
char* data;
int r;
write_req_t* wr;
ASSERT(req == &connect_req);
ASSERT(status == 0);
while (1) {
size = 10 * 1024 * 1024;
data = malloc(size);
ASSERT(data != NULL);
memset(data, '$', size);
buf = uv_buf_init(data, size);
wr = (write_req_t*) malloc(sizeof *wr);
wr->buf = buf;
wr->req.data = data;
r = uv_write(&(wr->req), req->handle, &wr->buf, 1, write_cb);
ASSERT(r == 0);
if (req->handle->write_queue_size >= size * 2) {
break;
}
}
}
static void write_cb(uv_write_t* req, int status) {
write_req_t* wr;
wr = (write_req_t*) req;
if (status == -1) {
write_cb_error_called++;
}
if (req->handle->write_queue_size == 0) {
uv_close((uv_handle_t*)&tcp_client, NULL);
}
free(wr->buf.base);
free(wr);
write_cb_called++;
}
/*
* Assert that a failing write does not leave
* the stream's write_queue_size in an inconsistent state.
*/
TEST_IMPL(tcp_write_error) {
uv_loop_t* loop;
int r;
loop = uv_default_loop();
ASSERT(loop != NULL);
r = uv_tcp_init(loop, &tcp_server);
ASSERT(r == 0);
r = uv_tcp_bind(&tcp_server, uv_ip4_addr("127.0.0.1", TEST_PORT));
ASSERT(r == 0);
r = uv_listen((uv_stream_t*)&tcp_server, 1, connection_cb);
ASSERT(r == 0);
r = uv_tcp_init(loop, &tcp_client);
ASSERT(r == 0);
r = uv_tcp_connect(&connect_req,
&tcp_client,
uv_ip4_addr("127.0.0.1", TEST_PORT),
connect_cb);
ASSERT(r == 0);
ASSERT(write_cb_called == 0);
r = uv_run(loop);
ASSERT(r == 0);
ASSERT(write_cb_called > 0);
ASSERT(write_cb_error_called >= 1);
ASSERT(tcp_client.write_queue_size == 0);
MAKE_VALGRIND_HAPPY();
return 0;
}

2
deps/uv/test/test-tcp-write-to-half-open-connection.c

@ -125,7 +125,7 @@ TEST_IMPL(tcp_write_to_half_open_connection) {
connect_cb);
ASSERT(r == 0);
r = uv_run(loop);
r = uv_run(loop, UV_RUN_DEFAULT);
ASSERT(r == 0);
ASSERT(write_cb_called > 0);

2
deps/uv/test/test-tcp-writealot.c

@ -154,7 +154,7 @@ TEST_IMPL(tcp_writealot) {
r = uv_tcp_connect(&connect_req, &client, addr, connect_cb);
ASSERT(r == 0);
uv_run(uv_default_loop());
uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(shutdown_cb_called == 1);
ASSERT(connect_cb_called == 1);

2
deps/uv/test/test-thread.c

@ -128,7 +128,7 @@ static void do_work(void* arg) {
fs_do(req);
}
r = uv_run(loop);
r = uv_run(loop, UV_RUN_DEFAULT);
ASSERT(r == 0);
uv_loop_delete(loop);

10
deps/uv/test/test-threadpool-cancel.c

@ -190,7 +190,7 @@ TEST_IMPL(threadpool_cancel_getaddrinfo) {
ASSERT(0 == uv_timer_init(loop, &ci.timer_handle));
ASSERT(0 == uv_timer_start(&ci.timer_handle, timer_cb, 10, 0));
ASSERT(0 == uv_run(loop));
ASSERT(0 == uv_run(loop, UV_RUN_DEFAULT));
ASSERT(1 == timer_cb_called);
cleanup_threadpool();
@ -214,7 +214,7 @@ TEST_IMPL(threadpool_cancel_work) {
ASSERT(0 == uv_timer_init(loop, &ci.timer_handle));
ASSERT(0 == uv_timer_start(&ci.timer_handle, timer_cb, 10, 0));
ASSERT(0 == uv_run(loop));
ASSERT(0 == uv_run(loop, UV_RUN_DEFAULT));
ASSERT(1 == timer_cb_called);
ASSERT(ARRAY_SIZE(reqs) == done2_cb_called);
@ -265,7 +265,7 @@ TEST_IMPL(threadpool_cancel_fs) {
ASSERT(0 == uv_timer_init(loop, &ci.timer_handle));
ASSERT(0 == uv_timer_start(&ci.timer_handle, timer_cb, 10, 0));
ASSERT(0 == uv_run(loop));
ASSERT(0 == uv_run(loop, UV_RUN_DEFAULT));
ASSERT(n == fs_cb_called);
ASSERT(1 == timer_cb_called);
@ -290,7 +290,7 @@ TEST_IMPL(threadpool_cancel_single) {
if (cancelled == 0)
break;
ASSERT(0 == uv_run(loop));
ASSERT(0 == uv_run(loop, UV_RUN_DEFAULT));
}
if (cancelled != 0) {
@ -300,7 +300,7 @@ TEST_IMPL(threadpool_cancel_single) {
}
ASSERT(req.data == NULL);
ASSERT(0 == uv_run(loop));
ASSERT(0 == uv_run(loop, UV_RUN_DEFAULT));
ASSERT(req.data != NULL); /* Should have been updated by nop_done_cb(). */
return 0;

4
deps/uv/test/test-threadpool.c

@ -49,7 +49,7 @@ TEST_IMPL(threadpool_queue_work_simple) {
work_req.data = &data;
r = uv_queue_work(uv_default_loop(), &work_req, work_cb, after_work_cb);
ASSERT(r == 0);
uv_run(uv_default_loop());
uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(work_cb_count == 1);
ASSERT(after_work_cb_count == 1);
@ -66,7 +66,7 @@ TEST_IMPL(threadpool_queue_work_einval) {
r = uv_queue_work(uv_default_loop(), &work_req, NULL, after_work_cb);
ASSERT(r == -1);
uv_run(uv_default_loop());
uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(uv_last_error(uv_default_loop()).code == UV_EINVAL);
ASSERT(work_cb_count == 0);

2
deps/uv/test/test-timer-again.c

@ -127,7 +127,7 @@ TEST_IMPL(timer_again) {
ASSERT(r == 0);
ASSERT(uv_timer_get_repeat(&repeat_2) == 100);
uv_run(uv_default_loop());
uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(repeat_1_cb_called == 10);
ASSERT(repeat_2_cb_called == 2);

4
deps/uv/test/test-timer.c

@ -120,7 +120,7 @@ TEST_IMPL(timer) {
ASSERT(r == 0);
uv_unref((uv_handle_t*)&never);
uv_run(uv_default_loop());
uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(once_cb_called == 10);
ASSERT(once_close_cb_called == 10);
@ -145,7 +145,7 @@ TEST_IMPL(timer_start_twice) {
ASSERT(r == 0);
r = uv_timer_start(&once, once_cb, 10, 0);
ASSERT(r == 0);
r = uv_run(uv_default_loop());
r = uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(r == 0);
ASSERT(once_cb_called == 1);

2
deps/uv/test/test-tty.c

@ -104,7 +104,7 @@ TEST_IMPL(tty) {
uv_close((uv_handle_t*) &tty_in, NULL);
uv_close((uv_handle_t*) &tty_out, NULL);
uv_run(loop);
uv_run(loop, UV_RUN_DEFAULT);
MAKE_VALGRIND_HAPPY();
return 0;

2
deps/uv/test/test-udp-dgram-too-big.c

@ -77,7 +77,7 @@ TEST_IMPL(udp_dgram_too_big) {
ASSERT(close_cb_called == 0);
ASSERT(send_cb_called == 0);
uv_run(uv_default_loop());
uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(send_cb_called == 1);
ASSERT(close_cb_called == 1);

2
deps/uv/test/test-udp-ipv6.c

@ -130,7 +130,7 @@ static void do_test(uv_udp_recv_cb recv_cb, int bind_flags) {
ASSERT(send_cb_called == 0);
ASSERT(recv_cb_called == 0);
uv_run(uv_default_loop());
uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(close_cb_called == 3);

2
deps/uv/test/test-udp-multicast-join.c

@ -129,7 +129,7 @@ TEST_IMPL(udp_multicast_join) {
ASSERT(sv_send_cb_called == 0);
/* run the loop till all events are processed */
uv_run(uv_default_loop());
uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(cl_recv_cb_called == 1);
ASSERT(sv_send_cb_called == 1);

2
deps/uv/test/test-udp-multicast-ttl.c

@ -77,7 +77,7 @@ TEST_IMPL(udp_multicast_ttl) {
ASSERT(sv_send_cb_called == 0);
/* run the loop till all events are processed */
uv_run(uv_default_loop());
uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(sv_send_cb_called == 1);
ASSERT(close_cb_called == 1);

2
deps/uv/test/test-udp-open.c

@ -144,7 +144,7 @@ TEST_IMPL(udp_open) {
r = uv_udp_send(&send_req, &client, &buf, 1, addr, send_cb);
ASSERT(r == 0);
uv_run(uv_default_loop());
uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(send_cb_called == 1);
ASSERT(close_cb_called == 1);

2
deps/uv/test/test-udp-options.c

@ -79,7 +79,7 @@ TEST_IMPL(udp_options) {
ASSERT(uv_last_error(loop).code == UV_EINVAL);
/* don't test ttl=-1, it's a valid value on some platforms */
r = uv_run(loop);
r = uv_run(loop, UV_RUN_DEFAULT);
ASSERT(r == 0);
MAKE_VALGRIND_HAPPY();

2
deps/uv/test/test-udp-send-and-recv.c

@ -196,7 +196,7 @@ TEST_IMPL(udp_send_and_recv) {
ASSERT(sv_send_cb_called == 0);
ASSERT(sv_recv_cb_called == 0);
uv_run(uv_default_loop());
uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(cl_send_cb_called == 1);
ASSERT(cl_recv_cb_called == 1);

2
deps/uv/test/test-walk-handles.c

@ -64,7 +64,7 @@ TEST_IMPL(walk_handles) {
/* Start event loop, expect to see the timer handle in walk_cb. */
ASSERT(seen_timer_handle == 0);
r = uv_run(loop);
r = uv_run(loop, UV_RUN_DEFAULT);
ASSERT(r == 0);
ASSERT(seen_timer_handle == 1);

1
deps/uv/uv.gyp

@ -303,7 +303,6 @@
'test/test-tcp-connect-timeout.c',
'test/test-tcp-connect6-error.c',
'test/test-tcp-open.c',
'test/test-tcp-write-error.c',
'test/test-tcp-write-to-half-open-connection.c',
'test/test-tcp-writealot.c',
'test/test-tcp-unexpected-read.c',

2
src/node.cc

@ -2988,7 +2988,7 @@ int Start(int argc, char *argv[]) {
// there are no watchers on the loop (except for the ones that were
// uv_unref'd) then this function exits. As long as there are active
// watchers, it blocks.
uv_run(uv_default_loop());
uv_run(uv_default_loop(), UV_RUN_DEFAULT);
EmitExit(process_l);
RunAtExit();

Loading…
Cancel
Save