aboutsummaryrefslogtreecommitdiff
path: root/src/test/util_tests.cpp
diff options
context:
space:
mode:
authorGavin Andresen <[email protected]>2011-11-21 11:33:14 -0800
committerGavin Andresen <[email protected]>2011-11-21 11:33:14 -0800
commit42eb76a0540d8332650b34ba0f949d403fcd8a89 (patch)
treec7c8e0fef9c6914c63b3e2ae3c23717ce9724ca0 /src/test/util_tests.cpp
parentMerge pull request #634 from laanwj/doxygen (diff)
parentAdded simple critical section test cases. (diff)
downloaddiscoin-42eb76a0540d8332650b34ba0f949d403fcd8a89.tar.xz
discoin-42eb76a0540d8332650b34ba0f949d403fcd8a89.zip
Merge pull request #602 from wowus/master
Cleaned up critical section code.
Diffstat (limited to 'src/test/util_tests.cpp')
-rw-r--r--src/test/util_tests.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/test/util_tests.cpp b/src/test/util_tests.cpp
index 8afc85c50..8c8b99e1b 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<int> filter(5, 15);