ext/libuv/test/test-ref.c in uvrb-0.1.4 vs ext/libuv/test/test-ref.c in uvrb-0.2.0

- old
+ new

@@ -411,5 +411,17 @@ do_close(&h); MAKE_VALGRIND_HAPPY(); return 0; } + + +TEST_IMPL(has_ref) { + uv_idle_t h; + uv_idle_init(uv_default_loop(), &h); + uv_ref((uv_handle_t*)&h); + ASSERT(uv_has_ref((uv_handle_t*)&h) == 1); + uv_unref((uv_handle_t*)&h); + ASSERT(uv_has_ref((uv_handle_t*)&h) == 0); + MAKE_VALGRIND_HAPPY(); + return 0; +}