From f873b84d6e91407cb6c9ea292d16baed6ec07779 Mon Sep 17 00:00:00 2001 From: Clark Gaebel Date: Wed, 2 Nov 2011 18:10:41 -0400 Subject: Added simple critical section test cases. --- src/test/util_tests.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/test') diff --git a/src/test/util_tests.cpp b/src/test/util_tests.cpp index 8afc85c507..8c8b99e1b2 100644 --- a/src/test/util_tests.cpp +++ b/src/test/util_tests.cpp @@ -8,6 +8,25 @@ using namespace std; BOOST_AUTO_TEST_SUITE(util_tests) +BOOST_AUTO_TEST_CASE(util_criticalsection) +{ + CCriticalSection cs; + + do { + CRITICAL_BLOCK(cs) + break; + + BOOST_ERROR("break was swallowed!"); + } while(0); + + do { + TRY_CRITICAL_BLOCK(cs) + break; + + BOOST_ERROR("break was swallowed!"); + } while(0); +} + BOOST_AUTO_TEST_CASE(util_MedianFilter) { CMedianFilter filter(5, 15); -- cgit v1.2.3