diff options
author | Bert Belder <bertbelder@gmail.com> | 2013-05-30 01:09:54 +0200 |
---|---|---|
committer | Bert Belder <bertbelder@gmail.com> | 2013-05-30 01:09:54 +0200 |
commit | 6b654c0b13f5399137ca71b177081ee6d0beb22e (patch) | |
tree | 81362751c0eca87a4f29c7f01f93408798a857f9 /deps/uv/test/test-idle.c | |
parent | c188a7510317bfdaa19e87c6870c5ee7d965a6b9 (diff) | |
download | android-node-v8-6b654c0b13f5399137ca71b177081ee6d0beb22e.tar.gz android-node-v8-6b654c0b13f5399137ca71b177081ee6d0beb22e.tar.bz2 android-node-v8-6b654c0b13f5399137ca71b177081ee6d0beb22e.zip |
uv: upgrade to v0.11.4
Diffstat (limited to 'deps/uv/test/test-idle.c')
-rw-r--r-- | deps/uv/test/test-idle.c | 21 |
1 files changed, 19 insertions, 2 deletions
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; |