diff options
Diffstat (limited to 'dbtests/threadedtests.cpp')
-rw-r--r-- | dbtests/threadedtests.cpp | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/dbtests/threadedtests.cpp b/dbtests/threadedtests.cpp index 2ffafba..af413cc 100644 --- a/dbtests/threadedtests.cpp +++ b/dbtests/threadedtests.cpp @@ -17,10 +17,10 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#include "stdafx.h" -#include "../util/atomic_int.h" -#include "../util/mvar.h" -#include "../util/thread_pool.h" +#include "pch.h" +#include "../bson/util/atomic_int.h" +#include "../util/concurrency/mvar.h" +#include "../util/concurrency/thread_pool.h" #include <boost/thread.hpp> #include <boost/bind.hpp> @@ -129,6 +129,20 @@ namespace ThreadedTests { } }; + class LockTest { + public: + void run(){ + // quick atomicint wrap test + // MSGID likely assumes this semantic + AtomicUInt counter = 0xffffffff; + counter++; + ASSERT( counter == 0 ); + + writelocktry lk( "" , 0 ); + ASSERT( lk.got() ); + } + }; + class All : public Suite { public: All() : Suite( "threading" ){ @@ -138,6 +152,7 @@ namespace ThreadedTests { add< IsAtomicUIntAtomic >(); add< MVarTest >(); add< ThreadPoolTest >(); + add< LockTest >(); } } myall; } |