From 6b654c0b13f5399137ca71b177081ee6d0beb22e Mon Sep 17 00:00:00 2001 From: Bert Belder Date: Thu, 30 May 2013 01:09:54 +0200 Subject: uv: upgrade to v0.11.4 --- deps/uv/test/test-idle.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'deps/uv/test/test-idle.c') diff --git a/deps/uv/test/test-idle.c b/deps/uv/test/test-idle.c index 4f0294cfa2..7eea1b83b1 100644 --- a/deps/uv/test/test-idle.c +++ b/deps/uv/test/test-idle.c @@ -23,10 +23,12 @@ #include "task.h" -static uv_timer_t timer_handle; static uv_idle_t idle_handle; +static uv_check_t check_handle; +static uv_timer_t timer_handle; static int idle_cb_called = 0; +static int check_cb_called = 0; static int timer_cb_called = 0; static int close_cb_called = 0; @@ -41,6 +43,7 @@ static void timer_cb(uv_timer_t* handle, int status) { ASSERT(status == 0); uv_close((uv_handle_t*) &idle_handle, close_cb); + uv_close((uv_handle_t*) &check_handle, close_cb); uv_close((uv_handle_t*) &timer_handle, close_cb); timer_cb_called++; @@ -57,6 +60,15 @@ static void idle_cb(uv_idle_t* handle, int status) { } +static void check_cb(uv_check_t* handle, int status) { + ASSERT(handle == &check_handle); + ASSERT(status == 0); + + check_cb_called++; + LOGF("check_cb %d\n", check_cb_called); +} + + TEST_IMPL(idle_starvation) { int r; @@ -65,6 +77,11 @@ TEST_IMPL(idle_starvation) { r = uv_idle_start(&idle_handle, idle_cb); ASSERT(r == 0); + r = uv_check_init(uv_default_loop(), &check_handle); + ASSERT(r == 0); + r = uv_check_start(&check_handle, check_cb); + ASSERT(r == 0); + r = uv_timer_init(uv_default_loop(), &timer_handle); ASSERT(r == 0); r = uv_timer_start(&timer_handle, timer_cb, 50, 0); @@ -75,7 +92,7 @@ TEST_IMPL(idle_starvation) { ASSERT(idle_cb_called > 0); ASSERT(timer_cb_called == 1); - ASSERT(close_cb_called == 2); + ASSERT(close_cb_called == 3); MAKE_VALGRIND_HAPPY(); return 0; -- cgit v1.2.3