Update of /cvsroot/boost/boost/libs/thread/test
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30255

Modified Files:
      Tag: thread_rewrite
        test_lock_concept.cpp 
Log Message:
Throw lock error if we try and unlock twice


Index: test_lock_concept.cpp
===================================================================
RCS file: /cvsroot/boost/boost/libs/thread/test/Attic/test_lock_concept.cpp,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -d -r1.1.2.1 -r1.1.2.2
--- test_lock_concept.cpp       8 Jun 2006 14:12:04 -0000       1.1.2.1
+++ test_lock_concept.cpp       8 Jun 2006 14:24:15 -0000       1.1.2.2
@@ -32,6 +32,15 @@
     BOOST_CHECK_THROW( lock.lock(), boost::lock_error );
 }
 
+void test_mutex_scoped_lock_throws_if_unlock_called_when_already_unlocked()
+{
+    boost::mutex m;
+    boost::mutex::scoped_lock lock(m);
+    lock.unlock();
+    
+    BOOST_CHECK_THROW( lock.unlock(), boost::lock_error );
+}
+
 boost::unit_test_framework::test_suite* init_unit_test_suite(int, char*[])
 {
     boost::unit_test_framework::test_suite* test =
@@ -40,6 +49,7 @@
     test->add(BOOST_TEST_CASE(&test_mutex_scoped_lock_initially_locked));
     
test->add(BOOST_TEST_CASE(&test_mutex_scoped_lock_unlocked_after_unlock_called));
     
test->add(BOOST_TEST_CASE(&test_mutex_scoped_lock_throws_if_lock_called_when_already_locked));
+    
test->add(BOOST_TEST_CASE(&test_mutex_scoped_lock_throws_if_unlock_called_when_already_unlocked));
 
     return test;
 }



_______________________________________________
Boost-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/boost-cvs

Reply via email to