From 4ba03ddd569bdd361b1498d5f19ec0075db01500 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Wed, 16 Jan 2013 23:20:03 +0100 Subject: [PATCH] unix, windows: rename uv_run2 to uv_run This changes the prototype of uv_run() from: int uv_run(uv_loop_t* loop); To: int uv_run(uv_loop_t* loop, uv_run_mode mode); Where `mode` is UV_RUN_DEFAULT, UV_RUN_ONCE or UV_RUN_NOWAIT. Fixes #683. --- include/uv.h | 8 +- src/unix/core.c | 7 +- src/win/core.c | 7 +- test/benchmark-async-pummel.c | 2 +- test/benchmark-async.c | 4 +- test/benchmark-fs-stat.c | 4 +- test/benchmark-getaddrinfo.c | 2 +- test/benchmark-loop-count.c | 4 +- test/benchmark-million-async.c | 2 +- test/benchmark-million-timers.c | 4 +- test/benchmark-multi-accept.c | 10 +-- test/benchmark-ping-pongs.c | 2 +- test/benchmark-pound.c | 2 +- test/benchmark-pump.c | 8 +- test/benchmark-spawn.c | 2 +- test/benchmark-tcp-write-batch.c | 2 +- test/benchmark-udp-pummel.c | 2 +- test/blackhole-server.c | 2 +- test/dns-server.c | 2 +- test/echo-server.c | 8 +- test/test-active.c | 2 +- test/test-async.c | 2 +- test/test-callback-order.c | 2 +- test/test-callback-stack.c | 2 +- test/test-connection-fail.c | 2 +- test/test-delayed-accept.c | 2 +- test/test-embed.c | 4 +- test/test-fs-event.c | 18 ++--- test/test-fs-poll.c | 2 +- test/test-fs.c | 76 +++++++++---------- test/test-getaddrinfo.c | 4 +- test/test-getsockname.c | 4 +- test/test-idle.c | 2 +- test/test-ipc-send-recv.c | 4 +- test/test-ipc.c | 6 +- test/test-loop-handles.c | 2 +- test/test-multiple-listen.c | 2 +- test/test-ping-pong.c | 6 +- test/test-pipe-bind-error.c | 8 +- test/test-pipe-connect-error.c | 4 +- test/test-poll-close.c | 2 +- test/test-poll.c | 2 +- test/test-ref.c | 48 ++++++------ test/test-run-nowait.c | 2 +- test/test-run-once.c | 2 +- test/test-shutdown-close.c | 4 +- test/test-shutdown-eof.c | 2 +- test/test-signal-multiple-loops.c | 8 +- test/test-signal.c | 8 +- test/test-spawn.c | 38 +++++----- test/test-stdio-over-pipes.c | 6 +- test/test-tcp-bind-error.c | 10 +-- test/test-tcp-bind6-error.c | 8 +- test/test-tcp-close-while-connecting.c | 2 +- test/test-tcp-close.c | 2 +- test/test-tcp-connect-error-after-write.c | 2 +- test/test-tcp-connect-error.c | 2 +- test/test-tcp-connect-timeout.c | 2 +- test/test-tcp-connect6-error.c | 2 +- test/test-tcp-flags.c | 2 +- test/test-tcp-open.c | 2 +- test/test-tcp-read-stop.c | 2 +- test/test-tcp-shutdown-after-write.c | 2 +- test/test-tcp-unexpected-read.c | 2 +- test/test-tcp-write-to-half-open-connection.c | 2 +- test/test-tcp-writealot.c | 2 +- test/test-thread.c | 2 +- test/test-threadpool-cancel.c | 10 +-- test/test-threadpool.c | 4 +- test/test-timer-again.c | 2 +- test/test-timer.c | 4 +- test/test-tty.c | 2 +- test/test-udp-dgram-too-big.c | 2 +- test/test-udp-ipv6.c | 2 +- test/test-udp-multicast-join.c | 2 +- test/test-udp-multicast-ttl.c | 2 +- test/test-udp-open.c | 2 +- test/test-udp-options.c | 2 +- test/test-udp-send-and-recv.c | 2 +- test/test-walk-handles.c | 2 +- 80 files changed, 214 insertions(+), 230 deletions(-) diff --git a/include/uv.h b/include/uv.h index 692a21c1..cfe297d6 100644 --- a/include/uv.h +++ b/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 diff --git a/src/unix/core.c b/src/unix/core.c index b4cb948b..6bf3f7b2 100644 --- a/src/unix/core.c +++ b/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); } diff --git a/src/win/core.c b/src/win/core.c index 0876feda..67558b49 100644 --- a/src/win/core.c +++ b/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); -} diff --git a/test/benchmark-async-pummel.c b/test/benchmark-async-pummel.c index 2f318967..4761c192 100644 --- a/test/benchmark-async-pummel.c +++ b/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; diff --git a/test/benchmark-async.c b/test/benchmark-async.c index 7d37ab41..7d3c936d 100644 --- a/test/benchmark-async.c +++ b/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)); diff --git a/test/benchmark-fs-stat.c b/test/benchmark-fs-stat.c index b0d7fe57..5c87de00 100644 --- a/test/benchmark-fs-stat.c +++ b/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", diff --git a/test/benchmark-getaddrinfo.c b/test/benchmark-getaddrinfo.c index 4a57b441..c7f99a2f 100644 --- a/test/benchmark-getaddrinfo.c +++ b/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); diff --git a/test/benchmark-loop-count.c b/test/benchmark-loop-count.c index ac3d16ad..b4ee0ed5 100644 --- a/test/benchmark-loop-count.c +++ b/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); diff --git a/test/benchmark-million-async.c b/test/benchmark-million-async.c index e03a7134..69cc8034 100644 --- a/test/benchmark-million-async.c +++ b/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., diff --git a/test/benchmark-million-timers.c b/test/benchmark-million-timers.c index b51c7cdf..fe887344 100644 --- a/test/benchmark-million-timers.c +++ b/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); diff --git a/test/benchmark-multi-accept.c b/test/benchmark-multi-accept.c index 36a004bc..c6333e71 100644 --- a/test/benchmark-multi-accept.c +++ b/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; } diff --git a/test/benchmark-ping-pongs.c b/test/benchmark-ping-pongs.c index 4518ef8d..8db7f963 100644 --- a/test/benchmark-ping-pongs.c +++ b/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); diff --git a/test/benchmark-pound.c b/test/benchmark-pound.c index 51f2ca2f..8669a14a 100644 --- a/test/benchmark-pound.c +++ b/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(); diff --git a/test/benchmark-pump.c b/test/benchmark-pump.c index bf81c4f8..6d01229c 100644 --- a/test/benchmark-pump.c +++ b/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(); } diff --git a/test/benchmark-spawn.c b/test/benchmark-spawn.c index ca0e8569..b9506064 100644 --- a/test/benchmark-spawn.c +++ b/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); diff --git a/test/benchmark-tcp-write-batch.c b/test/benchmark-tcp-write-batch.c index a0793d57..978cde0f 100644 --- a/test/benchmark-tcp-write-batch.c +++ b/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(); diff --git a/test/benchmark-udp-pummel.c b/test/benchmark-udp-pummel.c index 77d1e3c3..09574539 100644 --- a/test/benchmark-udp-pummel.c +++ b/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; diff --git a/test/blackhole-server.c b/test/blackhole-server.c index 765bb321..cbb936ff 100644 --- a/test/blackhole-server.c +++ b/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; diff --git a/test/dns-server.c b/test/dns-server.c index f89c3bcf..ba532771 100644 --- a/test/dns-server.c +++ b/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; } diff --git a/test/echo-server.c b/test/echo-server.c index a8cf6f84..79263c7a 100644 --- a/test/echo-server.c +++ b/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; } diff --git a/test/test-active.c b/test/test-active.c index 910d7608..1f3d5f1b 100644 --- a/test/test-active.c +++ b/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); diff --git a/test/test-async.c b/test/test-async.c index 6ab510bf..d4d94d5f 100644 --- a/test/test-async.c +++ b/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); diff --git a/test/test-callback-order.c b/test/test-callback-order.c index ed280e62..84231e1b 100644 --- a/test/test-callback-order.c +++ b/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); diff --git a/test/test-callback-stack.c b/test/test-callback-stack.c index 044a3e35..e8cfcb43 100644 --- a/test/test-callback-stack.c +++ b/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"); diff --git a/test/test-connection-fail.c b/test/test-connection-fail.c index d5cd82b2..e72b4e59 100644 --- a/test/test-connection-fail.c +++ b/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); diff --git a/test/test-delayed-accept.c b/test/test-delayed-accept.c index a5e09f9b..b15d8819 100644 --- a/test/test-delayed-accept.c +++ b/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); diff --git a/test/test-embed.c b/test/test-embed.c index a8c61e7a..7f485d1a 100644 --- a/test/test-embed.c +++ b/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); diff --git a/test/test-fs-event.c b/test/test-fs-event.c index 9218b874..37f9cf2e 100644 --- a/test/test-fs-event.c +++ b/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); diff --git a/test/test-fs-poll.c b/test/test-fs-poll.c index 20436cbe..f312d87f 100644 --- a/test/test-fs-poll.c +++ b/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); diff --git a/test/test-fs.c b/test/test-fs.c index ccf7793b..ddc3c73b 100644 --- a/test/test-fs.c +++ b/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(); diff --git a/test/test-getaddrinfo.c b/test/test-getaddrinfo.c index 6baf676b..dd022072 100644 --- a/test/test-getaddrinfo.c +++ b/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); diff --git a/test/test-getsockname.c b/test/test-getsockname.c index 7e2ae69a..2baa9d75 100644 --- a/test/test-getsockname.c +++ b/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); diff --git a/test/test-idle.c b/test/test-idle.c index 0a6e0dcc..4f0294cf 100644 --- a/test/test-idle.c +++ b/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); diff --git a/test/test-ipc-send-recv.c b/test/test-ipc-send-recv.c index 799e4f5e..90ac69f3 100644 --- a/test/test-ipc-send-recv.c +++ b/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(); diff --git a/test/test-ipc.c b/test/test-ipc.c index 3bdc8ea8..40a48b73 100644 --- a/test/test-ipc.c +++ b/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); diff --git a/test/test-loop-handles.c b/test/test-loop-handles.c index f57efb08..fdf92814 100644 --- a/test/test-loop-handles.c +++ b/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); diff --git a/test/test-multiple-listen.c b/test/test-multiple-listen.c index aced132f..4d52be12 100644 --- a/test/test-multiple-listen.c +++ b/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); diff --git a/test/test-ping-pong.c b/test/test-ping-pong.c index e7f7e9af..e5bf7c8b 100644 --- a/test/test-ping-pong.c +++ b/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); diff --git a/test/test-pipe-bind-error.c b/test/test-pipe-bind-error.c index 2d45fb3e..a07fa0f3 100644 --- a/test/test-pipe-bind-error.c +++ b/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); diff --git a/test/test-pipe-connect-error.c b/test/test-pipe-connect-error.c index c70a3ef8..fae1e1b2 100644 --- a/test/test-pipe-connect-error.c +++ b/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); diff --git a/test/test-poll-close.c b/test/test-poll-close.c index 9c80527b..70b775f2 100644 --- a/test/test-poll-close.c +++ b/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); diff --git a/test/test-poll.c b/test/test-poll.c index 039e95c5..1ca9c921 100644 --- a/test/test-poll.c +++ b/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. */ diff --git a/test/test-ref.c b/test/test-ref.c index 7b1de1dd..9fc214ab 100644 --- a/test/test-ref.c +++ b/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); diff --git a/test/test-run-nowait.c b/test/test-run-nowait.c index fe8dd894..ee4b36ff 100644 --- a/test/test-run-nowait.c +++ b/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); diff --git a/test/test-run-once.c b/test/test-run-once.c index ecd82a2c..e243de0a 100644 --- a/test/test-run-once.c +++ b/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(); diff --git a/test/test-shutdown-close.c b/test/test-shutdown-close.c index 6a372330..62596b93 100644 --- a/test/test-shutdown-close.c +++ b/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); diff --git a/test/test-shutdown-eof.c b/test/test-shutdown-eof.c index 6e55a7de..017525cd 100644 --- a/test/test-shutdown-eof.c +++ b/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); diff --git a/test/test-signal-multiple-loops.c b/test/test-signal-multiple-loops.c index d0223d56..c43e02b7 100644 --- a/test/test-signal-multiple-loops.c +++ b/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); diff --git a/test/test-signal.c b/test/test-signal.c index bf380686..9fb1c7f9 100644 --- a/test/test-signal.c +++ b/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); diff --git a/test/test-spawn.c b/test/test-spawn.c index c97595f1..a93e8763 100644 --- a/test/test-spawn.c +++ b/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); diff --git a/test/test-stdio-over-pipes.c b/test/test-stdio-over-pipes.c index c0028eec..923bf76b 100644 --- a/test/test-stdio-over-pipes.c +++ b/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); diff --git a/test/test-tcp-bind-error.c b/test/test-tcp-bind-error.c index 5c3be70a..03cf42ef 100644 --- a/test/test-tcp-bind-error.c +++ b/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); diff --git a/test/test-tcp-bind6-error.c b/test/test-tcp-bind6-error.c index f281b94e..f9f099e1 100644 --- a/test/test-tcp-bind6-error.c +++ b/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); diff --git a/test/test-tcp-close-while-connecting.c b/test/test-tcp-close-while-connecting.c index c8a8bda9..d19dcbfe 100644 --- a/test/test-tcp-close-while-connecting.c +++ b/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); diff --git a/test/test-tcp-close.c b/test/test-tcp-close.c index 321a0e46..59029326 100644 --- a/test/test-tcp-close.c +++ b/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); diff --git a/test/test-tcp-connect-error-after-write.c b/test/test-tcp-connect-error-after-write.c index 7fbbf7cb..e982c90a 100644 --- a/test/test-tcp-connect-error-after-write.c +++ b/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); diff --git a/test/test-tcp-connect-error.c b/test/test-tcp-connect-error.c index 20a5a403..b39eab97 100644 --- a/test/test-tcp-connect-error.c +++ b/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); diff --git a/test/test-tcp-connect-timeout.c b/test/test-tcp-connect-timeout.c index 8eb959b6..0569b6b0 100644 --- a/test/test-tcp-connect-timeout.c +++ b/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(); diff --git a/test/test-tcp-connect6-error.c b/test/test-tcp-connect6-error.c index 2eb55ca9..65f2f80f 100644 --- a/test/test-tcp-connect6-error.c +++ b/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); diff --git a/test/test-tcp-flags.c b/test/test-tcp-flags.c index 33c2002c..68afb39f 100644 --- a/test/test-tcp-flags.c +++ b/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(); diff --git a/test/test-tcp-open.c b/test/test-tcp-open.c index 75469931..fca3e111 100644 --- a/test/test-tcp-open.c +++ b/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); diff --git a/test/test-tcp-read-stop.c b/test/test-tcp-read-stop.c index 9ed30eed..cc6dd2ea 100644 --- a/test/test-tcp-read-stop.c +++ b/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; diff --git a/test/test-tcp-shutdown-after-write.c b/test/test-tcp-shutdown-after-write.c index b3e06f5f..a2e9e0f5 100644 --- a/test/test-tcp-shutdown-after-write.c +++ b/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); diff --git a/test/test-tcp-unexpected-read.c b/test/test-tcp-unexpected-read.c index 71db558d..e8fc53c3 100644 --- a/test/test-tcp-unexpected-read.c +++ b/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 diff --git a/test/test-tcp-write-to-half-open-connection.c b/test/test-tcp-write-to-half-open-connection.c index 8c338953..0447ac8c 100644 --- a/test/test-tcp-write-to-half-open-connection.c +++ b/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); diff --git a/test/test-tcp-writealot.c b/test/test-tcp-writealot.c index 05f18058..3ddcd6d2 100644 --- a/test/test-tcp-writealot.c +++ b/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); diff --git a/test/test-thread.c b/test/test-thread.c index 593bdd4f..4bec8428 100644 --- a/test/test-thread.c +++ b/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); diff --git a/test/test-threadpool-cancel.c b/test/test-threadpool-cancel.c index 970e9fee..78938f94 100644 --- a/test/test-threadpool-cancel.c +++ b/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; diff --git a/test/test-threadpool.c b/test/test-threadpool.c index bde9f472..8d096496 100644 --- a/test/test-threadpool.c +++ b/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); diff --git a/test/test-timer-again.c b/test/test-timer-again.c index 73bc5303..6de29046 100644 --- a/test/test-timer-again.c +++ b/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); diff --git a/test/test-timer.c b/test/test-timer.c index 61b4926f..b1accb1e 100644 --- a/test/test-timer.c +++ b/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); diff --git a/test/test-tty.c b/test/test-tty.c index 3bf37883..eb5d5df5 100644 --- a/test/test-tty.c +++ b/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; diff --git a/test/test-udp-dgram-too-big.c b/test/test-udp-dgram-too-big.c index ebf82de9..f3430764 100644 --- a/test/test-udp-dgram-too-big.c +++ b/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); diff --git a/test/test-udp-ipv6.c b/test/test-udp-ipv6.c index 883772ad..247fe8bf 100644 --- a/test/test-udp-ipv6.c +++ b/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); diff --git a/test/test-udp-multicast-join.c b/test/test-udp-multicast-join.c index e995012e..83ec46b8 100644 --- a/test/test-udp-multicast-join.c +++ b/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); diff --git a/test/test-udp-multicast-ttl.c b/test/test-udp-multicast-ttl.c index 3fd4be8d..6d369836 100644 --- a/test/test-udp-multicast-ttl.c +++ b/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); diff --git a/test/test-udp-open.c b/test/test-udp-open.c index bb6d28a2..5d27bdc0 100644 --- a/test/test-udp-open.c +++ b/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); diff --git a/test/test-udp-options.c b/test/test-udp-options.c index e7b21678..9d26d81c 100644 --- a/test/test-udp-options.c +++ b/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(); diff --git a/test/test-udp-send-and-recv.c b/test/test-udp-send-and-recv.c index 7f57c32d..37df5b62 100644 --- a/test/test-udp-send-and-recv.c +++ b/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); diff --git a/test/test-walk-handles.c b/test/test-walk-handles.c index 298f98f5..f2ae4156 100644 --- a/test/test-walk-handles.c +++ b/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);