From 4b7db28157052c6a402114a5796da809105886be Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Thu, 7 Jan 2016 20:46:46 -0800 Subject: [PATCH] [tests] Test that Timer::stop on a stopped timer is a no-op --- test/miscellaneous/timer.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/miscellaneous/timer.cpp b/test/miscellaneous/timer.cpp index aaac4e2f8..7e5928406 100644 --- a/test/miscellaneous/timer.cpp +++ b/test/miscellaneous/timer.cpp @@ -177,3 +177,11 @@ TEST(Timer, StartOverrides) { EXPECT_GE(totalTime, expectedTotalTime * 0.8); EXPECT_LE(totalTime, expectedTotalTime * 1.2); } + +TEST(Timer, CanStopNonStartedTimer) { + RunLoop loop; + + Timer timer; + timer.unref(); + timer.stop(); +}