aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorClark Gaebel <cgaebel@csclub.uwaterloo.ca>2011-11-02 18:10:41 -0400
committerClark Gaebel <cgaebel@csclub.uwaterloo.ca>2011-11-02 18:10:41 -0400
commitf873b84d6e91407cb6c9ea292d16baed6ec07779 (patch)
tree95ac873a020ee1bc1f8fc4fc59a96fa3e23a8cd7 /src/test
parent3083cf100ac78c5b2b2e5ebde5bdc2cac40cb706 (diff)
downloadbitcoin-f873b84d6e91407cb6c9ea292d16baed6ec07779.tar.xz
Added simple critical section test cases.
Diffstat (limited to 'src/test')
-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 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<int> filter(5, 15);