diff --git a/test/test-list.h b/test/test-list.h index fb85295b..499d6503 100644 --- a/test/test-list.h +++ b/test/test-list.h @@ -32,6 +32,11 @@ TEST_DECLARE (callback_stack) TEST_DECLARE (timer) TEST_DECLARE (timer_again) TEST_DECLARE (loop_handles) +TEST_DECLARE (ref) +TEST_DECLARE (idle_ref) +TEST_DECLARE (async_ref) +TEST_DECLARE (prepare_ref) +TEST_DECLARE (check_ref) TEST_DECLARE (async) TEST_DECLARE (fail_always) TEST_DECLARE (pass_always) @@ -65,6 +70,12 @@ TASK_LIST_START TEST_ENTRY (timer_again) + TEST_ENTRY (ref) + TEST_ENTRY (idle_ref) + TEST_ENTRY (async_ref) + TEST_ENTRY (prepare_ref) + TEST_ENTRY (check_ref) + TEST_ENTRY (loop_handles) TEST_ENTRY (async) @@ -75,3 +86,4 @@ TASK_LIST_START TEST_ENTRY (pass_always) #endif TASK_LIST_END + diff --git a/test/test-loop-handles.c b/test/test-loop-handles.c index 7b2c27c7..56d2160d 100644 --- a/test/test-loop-handles.c +++ b/test/test-loop-handles.c @@ -384,3 +384,53 @@ TEST_IMPL(loop_handles) { return 0; } + + +TEST_IMPL(ref) { + uv_init(alloc_cb); + uv_run(); + return 0; +} + + +TEST_IMPL(idle_ref) { + uv_handle_t h; + uv_init(alloc_cb); + uv_idle_init(&h, NULL, NULL); + uv_idle_start(&h, NULL); + uv_unref(&h); + uv_run(); + return 0; +} + + +TEST_IMPL(async_ref) { + uv_handle_t h; + uv_init(alloc_cb); + uv_async_init(&h, NULL, NULL, NULL); + uv_unref(&h); + uv_run(); + return 0; +} + + +TEST_IMPL(prepare_ref) { + uv_handle_t h; + uv_init(alloc_cb); + uv_prepare_init(&h, NULL, NULL); + uv_prepare_start(&h, NULL); + uv_unref(&h); + uv_run(); + return 0; +} + + +TEST_IMPL(check_ref) { + uv_handle_t h; + uv_init(alloc_cb); + uv_check_init(&h, NULL, NULL); + uv_check_start(&h, NULL); + uv_unref(&h); + uv_run(); + return 0; +}