From 98d563ad9ec3d44fd4d6f039c11ab0da2897de72 Mon Sep 17 00:00:00 2001 From: Michele Caini Date: Fri, 14 Oct 2016 17:49:40 +0200 Subject: [PATCH] tests fixed --- test/uvw/handle.cpp | 4 ++++ test/uvw/timer.cpp | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/test/uvw/handle.cpp b/test/uvw/handle.cpp index bd50b70a..242680f6 100644 --- a/test/uvw/handle.cpp +++ b/test/uvw/handle.cpp @@ -11,6 +11,10 @@ TEST(Handle, Functionalities) { ASSERT_NO_THROW(handle->close()); ASSERT_FALSE(handle->active()); + // this forces an internal call to the close callback + // (possible leak detected by valgrind otherwise) + loop->run(); + ASSERT_NO_THROW(handle->reference()); ASSERT_TRUE(handle->referenced()); ASSERT_NO_THROW(handle->unreference()); diff --git a/test/uvw/timer.cpp b/test/uvw/timer.cpp index baaeb926..41fc5511 100644 --- a/test/uvw/timer.cpp +++ b/test/uvw/timer.cpp @@ -108,6 +108,11 @@ TEST(Timer, Repeat) { ASSERT_NO_THROW(handle->repeat(uvw::TimerHandle::Time{42})); ASSERT_EQ(handle->repeat(), uvw::TimerHandle::Time{42}); + ASSERT_NO_THROW(handle->close()); + + // this forces an internal call to the close callback + // (possible leak detected by valgrind otherwise) + loop->run(); }