Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r77753 - in trunk/libs/thread/test: sync/futures/future sync/futures/promise sync/mutual_exclusion/locks/shared_lock/cons sync/mutual_exclusion/locks/unique_lock/cons sync/mutual_exclusion/locks/upgrade_lock/cons threads/thread/constr
From: vicente.botet_at_[hidden]
Date: 2012-04-04 11:14:07


Author: viboes
Date: 2012-04-04 11:14:05 EDT (Wed, 04 Apr 2012)
New Revision: 77753
URL: http://svn.boost.org/trac/boost/changeset/77753

Log:
Thread: Try to pass these test on Sun using BOOST_EXPLICIT_MOVE
Text files modified:
   trunk/libs/thread/test/sync/futures/future/dtor_pass.cpp | 31 ++++++++++++++++++++++++++++++-
   trunk/libs/thread/test/sync/futures/promise/default_pass.cpp | 6 +++---
   trunk/libs/thread/test/sync/futures/promise/dtor_pass.cpp | 10 +++++-----
   trunk/libs/thread/test/sync/futures/promise/get_future_pass.cpp | 6 +++---
   trunk/libs/thread/test/sync/futures/promise/move_assign_pass.cpp | 12 ++++++------
   trunk/libs/thread/test/sync/futures/promise/move_ctor_pass.cpp | 12 ++++++------
   trunk/libs/thread/test/sync/mutual_exclusion/locks/shared_lock/cons/move_assign_pass.cpp | 10 +++++-----
   trunk/libs/thread/test/sync/mutual_exclusion/locks/shared_lock/cons/move_ctor_pass.cpp | 2 +-
   trunk/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/cons/move_assign_pass.cpp | 2 +-
   trunk/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_pass.cpp | 2 +-
   trunk/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_upgrade_lock_pass.cpp | 2 +-
   trunk/libs/thread/test/sync/mutual_exclusion/locks/upgrade_lock/cons/move_assign_pass.cpp | 6 +++---
   trunk/libs/thread/test/sync/mutual_exclusion/locks/upgrade_lock/cons/move_ctor_pass.cpp | 2 +-
   trunk/libs/thread/test/threads/thread/constr/Frvalue_pass.cpp | 2 +-
   trunk/libs/thread/test/threads/thread/constr/move_pass.cpp | 2 +-
   15 files changed, 68 insertions(+), 39 deletions(-)

Modified: trunk/libs/thread/test/sync/futures/future/dtor_pass.cpp
==============================================================================
--- trunk/libs/thread/test/sync/futures/future/dtor_pass.cpp (original)
+++ trunk/libs/thread/test/sync/futures/future/dtor_pass.cpp 2012-04-04 11:14:05 EDT (Wed, 04 Apr 2012)
@@ -74,7 +74,36 @@
   }
   BOOST_TEST(test_alloc_base::count == 0);
 #endif
-
+ {
+ typedef int T;
+ boost::future<T> f;
+ {
+ boost::promise<T> p;
+ f = BOOST_EXPLICIT_MOVE(p.get_future());
+ BOOST_TEST(f.valid());
+ }
+ BOOST_TEST(f.valid());
+ }
+ {
+ typedef int& T;
+ boost::future<T> f;
+ {
+ boost::promise<T> p;
+ f = BOOST_EXPLICIT_MOVE(p.get_future());
+ BOOST_TEST(f.valid());
+ }
+ BOOST_TEST(f.valid());
+ }
+ {
+ typedef void T;
+ boost::future<T> f;
+ {
+ boost::promise<T> p;
+ f = BOOST_EXPLICIT_MOVE(p.get_future());
+ BOOST_TEST(f.valid());
+ }
+ BOOST_TEST(f.valid());
+ }
   return boost::report_errors();
 }
 

Modified: trunk/libs/thread/test/sync/futures/promise/default_pass.cpp
==============================================================================
--- trunk/libs/thread/test/sync/futures/promise/default_pass.cpp (original)
+++ trunk/libs/thread/test/sync/futures/promise/default_pass.cpp 2012-04-04 11:14:05 EDT (Wed, 04 Apr 2012)
@@ -28,18 +28,18 @@
 
   {
       boost::promise<int> p;
- boost::future<int> f = p.get_future();
+ boost::future<int> f = BOOST_EXPLICIT_MOVE(p.get_future());
       BOOST_TEST(f.valid());
   }
   {
       boost::promise<int&> p;
- boost::future<int&> f = p.get_future();
+ boost::future<int&> f = BOOST_EXPLICIT_MOVE(p.get_future());
       BOOST_TEST(f.valid());
   }
   {
       boost::promise<void> p;
       std::cout << __LINE__ << std::endl;
- boost::future<void> f = p.get_future();
+ boost::future<void> f = BOOST_EXPLICIT_MOVE(p.get_future());
       std::cout << __LINE__ << std::endl;
       BOOST_TEST(f.valid());
   }

Modified: trunk/libs/thread/test/sync/futures/promise/dtor_pass.cpp
==============================================================================
--- trunk/libs/thread/test/sync/futures/promise/dtor_pass.cpp (original)
+++ trunk/libs/thread/test/sync/futures/promise/dtor_pass.cpp 2012-04-04 11:14:05 EDT (Wed, 04 Apr 2012)
@@ -30,7 +30,7 @@
       boost::future<T> f;
       {
           boost::promise<T> p;
- f = p.get_future();
+ f = BOOST_EXPLICIT_MOVE(p.get_future());
           p.set_value(3);
       }
       BOOST_TEST(f.get() == 3);
@@ -40,7 +40,7 @@
       boost::future<T> f;
       {
           boost::promise<T> p;
- f = p.get_future();
+ f = BOOST_EXPLICIT_MOVE(p.get_future());
       }
       try
       {
@@ -58,7 +58,7 @@
       boost::future<T> f;
       {
           boost::promise<T> p;
- f = p.get_future();
+ f = BOOST_EXPLICIT_MOVE(p.get_future());
           p.set_value(i);
       }
       BOOST_TEST(&f.get() == &i);
@@ -85,7 +85,7 @@
       boost::future<T> f;
       {
           boost::promise<T> p;
- f = p.get_future();
+ f = BOOST_EXPLICIT_MOVE(p.get_future());
           p.set_value();
       }
       f.get();
@@ -96,7 +96,7 @@
       boost::future<T> f;
       {
           boost::promise<T> p;
- f = p.get_future();
+ f = BOOST_EXPLICIT_MOVE(p.get_future());
       }
       try
       {

Modified: trunk/libs/thread/test/sync/futures/promise/get_future_pass.cpp
==============================================================================
--- trunk/libs/thread/test/sync/futures/promise/get_future_pass.cpp (original)
+++ trunk/libs/thread/test/sync/futures/promise/get_future_pass.cpp 2012-04-04 11:14:05 EDT (Wed, 04 Apr 2012)
@@ -27,13 +27,13 @@
 {
   {
       boost::promise<double> p;
- boost::future<double> f = p.get_future();
+ boost::future<double> f = BOOST_EXPLICIT_MOVE(p.get_future());
       p.set_value(105.5);
       BOOST_TEST(f.get() == 105.5);
   }
   {
       boost::promise<double> p;
- boost::future<double> f = p.get_future();
+ boost::future<double> f = BOOST_EXPLICIT_MOVE(p.get_future());
       try
       {
           f = p.get_future();
@@ -49,7 +49,7 @@
       boost::promise<double> p0 = boost::move(p);
       try
       {
- boost::future<double> f = p.get_future();
+ boost::future<double> f = BOOST_EXPLICIT_MOVE(p.get_future());
           BOOST_TEST(false);
       }
       catch (const boost::future_error& e)

Modified: trunk/libs/thread/test/sync/futures/promise/move_assign_pass.cpp
==============================================================================
--- trunk/libs/thread/test/sync/futures/promise/move_assign_pass.cpp (original)
+++ trunk/libs/thread/test/sync/futures/promise/move_assign_pass.cpp 2012-04-04 11:14:05 EDT (Wed, 04 Apr 2012)
@@ -40,7 +40,7 @@
     BOOST_TEST(test_alloc_base::count == 2);
     p = boost::move(p0);
     BOOST_TEST(test_alloc_base::count == 1);
- boost::future<int> f = p.get_future();
+ boost::future<int> f = BOOST_EXPLICIT_MOVE(p.get_future());
     BOOST_TEST(test_alloc_base::count == 1);
     BOOST_TEST(f.valid());
     try
@@ -62,7 +62,7 @@
     BOOST_TEST(test_alloc_base::count == 2);
     p = boost::move(p0);
     BOOST_TEST(test_alloc_base::count == 1);
- boost::future<int&> f = p.get_future();
+ boost::future<int&> f = BOOST_EXPLICIT_MOVE(p.get_future());
     BOOST_TEST(test_alloc_base::count == 1);
     BOOST_TEST(f.valid());
     try
@@ -83,7 +83,7 @@
     BOOST_TEST(test_alloc_base::count == 2);
     p = boost::move(p0);
     BOOST_TEST(test_alloc_base::count == 1);
- boost::future<void> f = p.get_future();
+ boost::future<void> f = BOOST_EXPLICIT_MOVE(p.get_future());
     BOOST_TEST(test_alloc_base::count == 1);
     BOOST_TEST(f.valid());
     try
@@ -104,7 +104,7 @@
     boost::promise<int> p0;
     boost::promise<int> p;
     p = boost::move(p0);
- boost::future<int> f = p.get_future();
+ boost::future<int> f = BOOST_EXPLICIT_MOVE(p.get_future());
     BOOST_TEST(f.valid());
     try
     {
@@ -121,7 +121,7 @@
     boost::promise<int&> p0;
     boost::promise<int&> p;
     p = boost::move(p0);
- boost::future<int&> f = p.get_future();
+ boost::future<int&> f = BOOST_EXPLICIT_MOVE(p.get_future());
     BOOST_TEST(f.valid());
     try
     {
@@ -137,7 +137,7 @@
     boost::promise<void> p0;
     boost::promise<void> p;
     p = boost::move(p0);
- boost::future<void> f = p.get_future();
+ boost::future<void> f = BOOST_EXPLICIT_MOVE(p.get_future());
     BOOST_TEST(f.valid());
     try
     {

Modified: trunk/libs/thread/test/sync/futures/promise/move_ctor_pass.cpp
==============================================================================
--- trunk/libs/thread/test/sync/futures/promise/move_ctor_pass.cpp (original)
+++ trunk/libs/thread/test/sync/futures/promise/move_ctor_pass.cpp 2012-04-04 11:14:05 EDT (Wed, 04 Apr 2012)
@@ -38,7 +38,7 @@
     boost::promise<int> p(boost::move(p0));
     BOOST_TEST(test_alloc_base::count == 1);
     std::cout << __LINE__ << std::endl;
- boost::future<int> f = p.get_future();
+ boost::future<int> f = BOOST_EXPLICIT_MOVE(p.get_future());
     std::cout << __LINE__ << std::endl;
     BOOST_TEST(test_alloc_base::count == 1);
     BOOST_TEST(f.valid());
@@ -61,7 +61,7 @@
     boost::promise<int&> p0(boost::allocator_arg, test_allocator<int>());
     boost::promise<int&> p(boost::move(p0));
     BOOST_TEST(test_alloc_base::count == 1);
- boost::future<int&> f = p.get_future();
+ boost::future<int&> f = BOOST_EXPLICIT_MOVE(p.get_future());
     BOOST_TEST(test_alloc_base::count == 1);
     BOOST_TEST(f.valid());
     try
@@ -80,7 +80,7 @@
     boost::promise<void> p0(boost::allocator_arg, test_allocator<void>());
     boost::promise<void> p(boost::move(p0));
     BOOST_TEST(test_alloc_base::count == 1);
- boost::future<void> f = p.get_future();
+ boost::future<void> f = BOOST_EXPLICIT_MOVE(p.get_future());
     BOOST_TEST(test_alloc_base::count == 1);
     BOOST_TEST(f.valid());
     try
@@ -100,7 +100,7 @@
     boost::promise<int> p0;
     boost::promise<int> p(boost::move(p0));
     std::cout << __LINE__ << std::endl;
- boost::future<int> f = p.get_future();
+ boost::future<int> f = BOOST_EXPLICIT_MOVE(p.get_future());
     std::cout << __LINE__ << std::endl;
     BOOST_TEST(f.valid());
     std::cout << __LINE__ << std::endl;
@@ -119,7 +119,7 @@
   {
     boost::promise<int&> p0;
     boost::promise<int&> p(boost::move(p0));
- boost::future<int&> f = p.get_future();
+ boost::future<int&> f = BOOST_EXPLICIT_MOVE(p.get_future());
     BOOST_TEST(f.valid());
     try
     {
@@ -134,7 +134,7 @@
   {
     boost::promise<void> p0;
     boost::promise<void> p(boost::move(p0));
- boost::future<void> f = p.get_future();
+ boost::future<void> f = BOOST_EXPLICIT_MOVE(p.get_future());
     BOOST_TEST(f.valid());
     try
     {

Modified: trunk/libs/thread/test/sync/mutual_exclusion/locks/shared_lock/cons/move_assign_pass.cpp
==============================================================================
--- trunk/libs/thread/test/sync/mutual_exclusion/locks/shared_lock/cons/move_assign_pass.cpp (original)
+++ trunk/libs/thread/test/sync/mutual_exclusion/locks/shared_lock/cons/move_assign_pass.cpp 2012-04-04 11:14:05 EDT (Wed, 04 Apr 2012)
@@ -40,14 +40,14 @@
   {
 
     boost::shared_lock<boost::shared_mutex> lk1;
- lk1 = boost::shared_lock<boost::shared_mutex>(m0);
+ lk1 = BOOST_EXPLICIT_MOVE(boost::shared_lock<boost::shared_mutex>(m0));
     BOOST_TEST(lk1.mutex() == &m0);
     BOOST_TEST(lk1.owns_lock() == true);
   }
   {
     boost::unique_lock<boost::shared_mutex> lk0(m0);
     boost::shared_lock<boost::shared_mutex> lk1(m1);
- lk1 = boost::shared_lock<boost::shared_mutex>(boost::move(lk0));
+ lk1 = BOOST_EXPLICIT_MOVE(boost::shared_lock<boost::shared_mutex>(boost::move(lk0)));
     BOOST_TEST(lk1.mutex() == &m0);
     BOOST_TEST(lk1.owns_lock() == true);
     BOOST_TEST(lk0.mutex() == 0);
@@ -56,14 +56,14 @@
   {
 
     boost::shared_lock<boost::shared_mutex> lk1;
- lk1 = boost::shared_lock<boost::shared_mutex>(boost::unique_lock<boost::shared_mutex>(m0));
+ lk1 = BOOST_EXPLICIT_MOVE(boost::shared_lock<boost::shared_mutex>(boost::unique_lock<boost::shared_mutex>(m0)));
     BOOST_TEST(lk1.mutex() == &m0);
     BOOST_TEST(lk1.owns_lock() == true);
   }
   {
     boost::upgrade_lock<boost::shared_mutex> lk0(m0);
     boost::shared_lock<boost::shared_mutex> lk1(m1);
- lk1 = boost::shared_lock<boost::shared_mutex>(boost::move(lk0));
+ lk1 = BOOST_EXPLICIT_MOVE(boost::shared_lock<boost::shared_mutex>(boost::move(lk0)));
     BOOST_TEST(lk1.mutex() == &m0);
     BOOST_TEST(lk1.owns_lock() == true);
     BOOST_TEST(lk0.mutex() == 0);
@@ -72,7 +72,7 @@
   {
 
     boost::shared_lock<boost::shared_mutex> lk1;
- lk1 = boost::shared_lock<boost::shared_mutex>(boost::upgrade_lock<boost::shared_mutex>(m0));
+ lk1 = BOOST_EXPLICIT_MOVE(boost::shared_lock<boost::shared_mutex>(boost::upgrade_lock<boost::shared_mutex>(m0)));
     BOOST_TEST(lk1.mutex() == &m0);
     BOOST_TEST(lk1.owns_lock() == true);
   }

Modified: trunk/libs/thread/test/sync/mutual_exclusion/locks/shared_lock/cons/move_ctor_pass.cpp
==============================================================================
--- trunk/libs/thread/test/sync/mutual_exclusion/locks/shared_lock/cons/move_ctor_pass.cpp (original)
+++ trunk/libs/thread/test/sync/mutual_exclusion/locks/shared_lock/cons/move_ctor_pass.cpp 2012-04-04 11:14:05 EDT (Wed, 04 Apr 2012)
@@ -36,7 +36,7 @@
   BOOST_TEST(lk0.owns_lock() == false);
   }
   {
- boost::shared_lock<boost::shared_mutex> lk( (boost::shared_lock<boost::shared_mutex>(m)));
+ boost::shared_lock<boost::shared_mutex> lk( (BOOST_EXPLICIT_MOVE(boost::shared_lock<boost::shared_mutex>(m))));
   BOOST_TEST(lk.mutex() == &m);
   BOOST_TEST(lk.owns_lock() == true);
   }

Modified: trunk/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/cons/move_assign_pass.cpp
==============================================================================
--- trunk/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/cons/move_assign_pass.cpp (original)
+++ trunk/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/cons/move_assign_pass.cpp 2012-04-04 11:14:05 EDT (Wed, 04 Apr 2012)
@@ -42,7 +42,7 @@
   {
 
     boost::unique_lock<boost::mutex> lk1;
- lk1 = boost::unique_lock<boost::mutex>(m0);
+ lk1 = BOOST_EXPLICIT_MOVE(boost::unique_lock<boost::mutex>(m0));
     BOOST_TEST(lk1.mutex() == &m0);
     BOOST_TEST(lk1.owns_lock() == true);
   }

Modified: trunk/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_pass.cpp
==============================================================================
--- trunk/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_pass.cpp (original)
+++ trunk/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_pass.cpp 2012-04-04 11:14:05 EDT (Wed, 04 Apr 2012)
@@ -36,7 +36,7 @@
   BOOST_TEST(lk0.owns_lock() == false);
   }
   {
- boost::unique_lock<boost::mutex> lk( (boost::unique_lock<boost::mutex>(m)));
+ boost::unique_lock<boost::mutex> lk( (BOOST_EXPLICIT_MOVE(boost::unique_lock<boost::mutex>(m))));
   BOOST_TEST(lk.mutex() == &m);
   BOOST_TEST(lk.owns_lock() == true);
   }

Modified: trunk/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_upgrade_lock_pass.cpp
==============================================================================
--- trunk/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_upgrade_lock_pass.cpp (original)
+++ trunk/libs/thread/test/sync/mutual_exclusion/locks/unique_lock/cons/move_ctor_upgrade_lock_pass.cpp 2012-04-04 11:14:05 EDT (Wed, 04 Apr 2012)
@@ -36,7 +36,7 @@
   BOOST_TEST(lk0.owns_lock() == false);
   }
   {
- boost::unique_lock<boost::upgrade_mutex> lk( (boost::upgrade_lock<boost::upgrade_mutex>(m)));
+ boost::unique_lock<boost::upgrade_mutex> lk( (BOOST_EXPLICIT_MOVE(boost::upgrade_lock<boost::upgrade_mutex>(m))));
   BOOST_TEST(lk.mutex() == &m);
   BOOST_TEST(lk.owns_lock() == true);
   }

Modified: trunk/libs/thread/test/sync/mutual_exclusion/locks/upgrade_lock/cons/move_assign_pass.cpp
==============================================================================
--- trunk/libs/thread/test/sync/mutual_exclusion/locks/upgrade_lock/cons/move_assign_pass.cpp (original)
+++ trunk/libs/thread/test/sync/mutual_exclusion/locks/upgrade_lock/cons/move_assign_pass.cpp 2012-04-04 11:14:05 EDT (Wed, 04 Apr 2012)
@@ -40,14 +40,14 @@
   {
 
     boost::upgrade_lock<boost::shared_mutex> lk1;
- lk1 = boost::upgrade_lock<boost::shared_mutex>(m0);
+ lk1 = BOOST_EXPLICIT_MOVE(boost::upgrade_lock<boost::shared_mutex>(m0));
     BOOST_TEST(lk1.mutex() == &m0);
     BOOST_TEST(lk1.owns_lock() == true);
   }
   {
     boost::unique_lock<boost::shared_mutex> lk0(m0);
     boost::upgrade_lock<boost::shared_mutex> lk1(m1);
- lk1 = boost::upgrade_lock<boost::shared_mutex>(boost::move(lk0));
+ lk1 = BOOST_EXPLICIT_MOVE(boost::upgrade_lock<boost::shared_mutex>(boost::move(lk0)));
     BOOST_TEST(lk1.mutex() == &m0);
     BOOST_TEST(lk1.owns_lock() == true);
     BOOST_TEST(lk0.mutex() == 0);
@@ -56,7 +56,7 @@
   {
 
     boost::upgrade_lock<boost::shared_mutex> lk1;
- lk1 = boost::upgrade_lock<boost::shared_mutex>(boost::unique_lock<boost::shared_mutex>(m0));
+ lk1 = BOOST_EXPLICIT_MOVE(boost::upgrade_lock<boost::shared_mutex>(boost::unique_lock<boost::shared_mutex>(m0)));
     BOOST_TEST(lk1.mutex() == &m0);
     BOOST_TEST(lk1.owns_lock() == true);
   }

Modified: trunk/libs/thread/test/sync/mutual_exclusion/locks/upgrade_lock/cons/move_ctor_pass.cpp
==============================================================================
--- trunk/libs/thread/test/sync/mutual_exclusion/locks/upgrade_lock/cons/move_ctor_pass.cpp (original)
+++ trunk/libs/thread/test/sync/mutual_exclusion/locks/upgrade_lock/cons/move_ctor_pass.cpp 2012-04-04 11:14:05 EDT (Wed, 04 Apr 2012)
@@ -36,7 +36,7 @@
   BOOST_TEST(lk0.owns_lock() == false);
   }
   {
- boost::upgrade_lock<boost::shared_mutex> lk( (boost::upgrade_lock<boost::shared_mutex>(m)));
+ boost::upgrade_lock<boost::shared_mutex> lk( (BOOST_EXPLICIT_MOVE(boost::upgrade_lock<boost::shared_mutex>(m))));
   BOOST_TEST(lk.mutex() == &m);
   BOOST_TEST(lk.owns_lock() == true);
   }

Modified: trunk/libs/thread/test/threads/thread/constr/Frvalue_pass.cpp
==============================================================================
--- trunk/libs/thread/test/threads/thread/constr/Frvalue_pass.cpp (original)
+++ trunk/libs/thread/test/threads/thread/constr/Frvalue_pass.cpp 2012-04-04 11:14:05 EDT (Wed, 04 Apr 2012)
@@ -77,7 +77,7 @@
 };
 
 MoveOnly MakeMoveOnly() {
- return MoveOnly();
+ return BOOST_EXPLICIT_MOVE(MoveOnly());
 }
 
 int main()

Modified: trunk/libs/thread/test/threads/thread/constr/move_pass.cpp
==============================================================================
--- trunk/libs/thread/test/threads/thread/constr/move_pass.cpp (original)
+++ trunk/libs/thread/test/threads/thread/constr/move_pass.cpp 2012-04-04 11:14:05 EDT (Wed, 04 Apr 2012)
@@ -84,7 +84,7 @@
   }
   BOOST_TEST(G::n_alive == 0);
   {
- boost::thread t1((make_thread()));
+ boost::thread t1((BOOST_EXPLICIT_MOVE(make_thread())));
     t1.join();
     BOOST_TEST(G::op_run);
   }


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk