From 9926d989f3e22082b6b3da129d1f724606010042 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Wed, 18 Nov 2015 00:05:25 +0000 Subject: Add missing test for semaphore inital value --- libadhocutil/unittests/testSemaphore.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libadhocutil/unittests/testSemaphore.cpp b/libadhocutil/unittests/testSemaphore.cpp index b5e435e..bde73a1 100644 --- a/libadhocutil/unittests/testSemaphore.cpp +++ b/libadhocutil/unittests/testSemaphore.cpp @@ -11,6 +11,14 @@ BOOST_AUTO_TEST_CASE( addRemoveOne ) s.wait(); } +BOOST_AUTO_TEST_CASE( initial ) +{ + AdHoc::Semaphore s(2); + s.wait(); + s.wait(); + BOOST_REQUIRE_EQUAL(false, s.wait(0)); +} + BOOST_AUTO_TEST_CASE( addRemoveSome ) { AdHoc::Semaphore s; -- cgit v1.2.3