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

Modified Files:
      Tag: thread_rewrite
        test_lock_concept.cpp 
Log Message:
Templated test_initially_locked_with_bool_parameter_true


Index: test_lock_concept.cpp
===================================================================
RCS file: /cvsroot/boost/boost/libs/thread/test/Attic/test_lock_concept.cpp,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.5
diff -u -d -r1.1.2.4 -r1.1.2.5
--- test_lock_concept.cpp       8 Jun 2006 14:40:43 -0000       1.1.2.4
+++ test_lock_concept.cpp       8 Jun 2006 14:42:41 -0000       1.1.2.5
@@ -19,14 +19,19 @@
     }
 };
 
-void test_mutex_scoped_lock_initially_locked_with_bool_parameter_true()
+template<typename Mutex,typename Lock>
+struct test_initially_locked_with_bool_parameter_true
 {
-    boost::mutex m;
-    boost::mutex::scoped_lock lock(m,true);
+    void operator()() const
+    {
+        Mutex m;
+        Lock lock(m,true);
     
-    BOOST_CHECK(lock);
-    BOOST_CHECK(lock.locked());
-}
+        BOOST_CHECK(lock);
+        BOOST_CHECK(lock.locked());
+    }
+};
+
 
 void test_mutex_scoped_lock_initially_unlocked_with_bool_parameter_false()
 {
@@ -79,7 +84,9 @@
 
     
test->add(BOOST_TEST_CASE((test_initially_locked<boost::mutex,boost::mutex::scoped_lock>())));
     
test->add(BOOST_TEST_CASE((test_initially_locked<boost::try_mutex,boost::try_mutex::scoped_lock>())));
-    
test->add(BOOST_TEST_CASE(&test_mutex_scoped_lock_initially_locked_with_bool_parameter_true));
+    
test->add(BOOST_TEST_CASE((test_initially_locked_with_bool_parameter_true<boost::mutex,boost::mutex::scoped_lock>())));
+    
test->add(BOOST_TEST_CASE((test_initially_locked_with_bool_parameter_true<boost::try_mutex,boost::try_mutex::scoped_lock>())));
+    
test->add(BOOST_TEST_CASE((test_initially_locked_with_bool_parameter_true<boost::try_mutex,boost::try_mutex::scoped_try_lock>())));
     
test->add(BOOST_TEST_CASE(&test_mutex_scoped_lock_initially_unlocked_with_bool_parameter_false));
     
test->add(BOOST_TEST_CASE(&test_mutex_scoped_lock_unlocked_after_unlock_called));
     
test->add(BOOST_TEST_CASE(&test_mutex_scoped_lock_locked_after_lock_called));



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

Reply via email to