git://git.novaco.in
/
novacoin.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
3083cf1
)
Added simple critical section test cases.
author
Clark Gaebel
<cgaebel@csclub.uwaterloo.ca>
Wed, 2 Nov 2011 22:10:41 +0000 (18:10 -0400)
committer
Clark Gaebel
<cgaebel@csclub.uwaterloo.ca>
Wed, 2 Nov 2011 22:10:41 +0000 (18:10 -0400)
src/test/util_tests.cpp
patch
|
blob
|
history
diff --git
a/src/test/util_tests.cpp
b/src/test/util_tests.cpp
index
8afc85c
..
8c8b99e
100644
(file)
--- 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);