summaryrefslogtreecommitdiff
path: root/deps/uv/test/test-ref.c
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2013-01-11 13:49:45 +0100
committerBen Noordhuis <info@bnoordhuis.nl>2013-01-11 14:00:19 +0100
commit31fc52ab53b5dde882ebadbbc912c2848c7b6a83 (patch)
tree11aa3925416fc156a9ccee5f37415a31d9104c52 /deps/uv/test/test-ref.c
parentdc0c524ce681f53e2bd8f0974ed6aa3fd910054d (diff)
downloadandroid-node-v8-31fc52ab53b5dde882ebadbbc912c2848c7b6a83.tar.gz
android-node-v8-31fc52ab53b5dde882ebadbbc912c2848c7b6a83.tar.bz2
android-node-v8-31fc52ab53b5dde882ebadbbc912c2848c7b6a83.zip
deps: upgrade libuv to 9aab5d4
Diffstat (limited to 'deps/uv/test/test-ref.c')
-rw-r--r--deps/uv/test/test-ref.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/deps/uv/test/test-ref.c b/deps/uv/test/test-ref.c
index bc0030d34a..7b1de1ddfc 100644
--- a/deps/uv/test/test-ref.c
+++ b/deps/uv/test/test-ref.c
@@ -58,6 +58,11 @@ static void fail_cb(void) {
}
+static void fail_cb2(void) {
+ ASSERT(0 && "fail_cb2 should not have been called");
+}
+
+
static void req_cb(uv_handle_t* req, int status) {
req_cb_called++;
}
@@ -104,7 +109,7 @@ TEST_IMPL(ref) {
TEST_IMPL(idle_ref) {
uv_idle_t h;
uv_idle_init(uv_default_loop(), &h);
- uv_idle_start(&h, NULL);
+ uv_idle_start(&h, (uv_idle_cb) fail_cb2);
uv_unref((uv_handle_t*)&h);
uv_run(uv_default_loop());
do_close(&h);
@@ -127,7 +132,7 @@ TEST_IMPL(async_ref) {
TEST_IMPL(prepare_ref) {
uv_prepare_t h;
uv_prepare_init(uv_default_loop(), &h);
- uv_prepare_start(&h, NULL);
+ uv_prepare_start(&h, (uv_prepare_cb) fail_cb2);
uv_unref((uv_handle_t*)&h);
uv_run(uv_default_loop());
do_close(&h);
@@ -139,7 +144,7 @@ TEST_IMPL(prepare_ref) {
TEST_IMPL(check_ref) {
uv_check_t h;
uv_check_init(uv_default_loop(), &h);
- uv_check_start(&h, NULL);
+ uv_check_start(&h, (uv_check_cb) fail_cb2);
uv_unref((uv_handle_t*)&h);
uv_run(uv_default_loop());
do_close(&h);
@@ -235,19 +240,12 @@ TEST_IMPL(tcp_ref2) {
}
-static void tcp_ref2b_close_cb(uv_handle_t* handle) {
- (*(int*) handle->data)++;
-}
-
-
TEST_IMPL(tcp_ref2b) {
- int close_cb_called = 0;
uv_tcp_t h;
- h.data = &close_cb_called;
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_close((uv_handle_t*)&h, tcp_ref2b_close_cb);
+ uv_close((uv_handle_t*)&h, close_cb);
uv_run(uv_default_loop());
ASSERT(close_cb_called == 1);
MAKE_VALGRIND_HAPPY();