Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r50491 - sandbox/move/libs/move/test
From: daniel_james_at_[hidden]
Date: 2009-01-06 03:17:11


Author: danieljames
Date: 2009-01-06 03:17:08 EST (Tue, 06 Jan 2009)
New Revision: 50491
URL: http://svn.boost.org/trac/boost/changeset/50491

Log:
Rename x.hpp and y.hpp to more descriptive names.
Added:
   sandbox/move/libs/move/test/movable.hpp
      - copied, changed from r50489, /sandbox/move/libs/move/test/x.hpp
   sandbox/move/libs/move/test/noncopyable.hpp
      - copied, changed from r50489, /sandbox/move/libs/move/test/y.hpp
Removed:
   sandbox/move/libs/move/test/x.hpp
   sandbox/move/libs/move/test/y.hpp
Text files modified:
   sandbox/move/libs/move/test/const_lvalue_by_ref_fail.cpp | 2 +-
   sandbox/move/libs/move/test/const_rvalue_by_ref_fail.cpp | 2 +-
   sandbox/move/libs/move/test/move.cpp | 2 +-
   sandbox/move/libs/move/test/move_boost_move.cpp | 4 ++--
   sandbox/move/libs/move/test/noncopyable.cpp | 2 +-
   sandbox/move/libs/move/test/noncopyable_copy_const_fail.cpp | 2 +-
   sandbox/move/libs/move/test/rvalue_by_ref_fail.cpp | 2 +-
   7 files changed, 8 insertions(+), 8 deletions(-)

Modified: sandbox/move/libs/move/test/const_lvalue_by_ref_fail.cpp
==============================================================================
--- sandbox/move/libs/move/test/const_lvalue_by_ref_fail.cpp (original)
+++ sandbox/move/libs/move/test/const_lvalue_by_ref_fail.cpp 2009-01-06 03:17:08 EST (Tue, 06 Jan 2009)
@@ -1,7 +1,7 @@
 // Copyright David Abrahams 2004. Distributed under the Boost
 // Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-#include "x.hpp"
+#include "movable.hpp"
 
 int f(X&);
 X const& g();

Modified: sandbox/move/libs/move/test/const_rvalue_by_ref_fail.cpp
==============================================================================
--- sandbox/move/libs/move/test/const_rvalue_by_ref_fail.cpp (original)
+++ sandbox/move/libs/move/test/const_rvalue_by_ref_fail.cpp 2009-01-06 03:17:08 EST (Tue, 06 Jan 2009)
@@ -1,7 +1,7 @@
 // Copyright David Abrahams 2004. Distributed under the Boost
 // Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-#include "x.hpp"
+#include "movable.hpp"
 
 int f(X&);
 X const g();

Copied: sandbox/move/libs/move/test/movable.hpp (from r50489, /sandbox/move/libs/move/test/x.hpp)
==============================================================================

Modified: sandbox/move/libs/move/test/move.cpp
==============================================================================
--- sandbox/move/libs/move/test/move.cpp (original)
+++ sandbox/move/libs/move/test/move.cpp 2009-01-06 03:17:08 EST (Tue, 06 Jan 2009)
@@ -6,7 +6,7 @@
 #include <boost/move/move.hpp>
 #include <boost/static_assert.hpp>
 #include "say.hpp"
-#include "x.hpp"
+#include "movable.hpp"
 
 //
 // Some functions we can use to test the passing of Xs in and out of

Modified: sandbox/move/libs/move/test/move_boost_move.cpp
==============================================================================
--- sandbox/move/libs/move/test/move_boost_move.cpp (original)
+++ sandbox/move/libs/move/test/move_boost_move.cpp 2009-01-06 03:17:08 EST (Tue, 06 Jan 2009)
@@ -4,8 +4,8 @@
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
 #define DEBUG_MOVE
-#include "x.hpp"
-#include "y.hpp"
+#include "movable.hpp"
+#include "noncopyable.hpp"
 
 #include <boost/static_assert.hpp>
 #include "./generic_tests.hpp"

Modified: sandbox/move/libs/move/test/noncopyable.cpp
==============================================================================
--- sandbox/move/libs/move/test/noncopyable.cpp (original)
+++ sandbox/move/libs/move/test/noncopyable.cpp 2009-01-06 03:17:08 EST (Tue, 06 Jan 2009)
@@ -7,7 +7,7 @@
 #include <boost/move/move.hpp>
 #include <boost/static_assert.hpp>
 #include "say.hpp"
-#include "y.hpp"
+#include "noncopyable.hpp"
 #include "./generic_tests.hpp"
 
 

Copied: sandbox/move/libs/move/test/noncopyable.hpp (from r50489, /sandbox/move/libs/move/test/y.hpp)
==============================================================================

Modified: sandbox/move/libs/move/test/noncopyable_copy_const_fail.cpp
==============================================================================
--- sandbox/move/libs/move/test/noncopyable_copy_const_fail.cpp (original)
+++ sandbox/move/libs/move/test/noncopyable_copy_const_fail.cpp 2009-01-06 03:17:08 EST (Tue, 06 Jan 2009)
@@ -3,7 +3,7 @@
 // Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
-#include "y.hpp"
+#include "noncopyable.hpp"
 
 int main() {
     Y const y_const;

Modified: sandbox/move/libs/move/test/rvalue_by_ref_fail.cpp
==============================================================================
--- sandbox/move/libs/move/test/rvalue_by_ref_fail.cpp (original)
+++ sandbox/move/libs/move/test/rvalue_by_ref_fail.cpp 2009-01-06 03:17:08 EST (Tue, 06 Jan 2009)
@@ -1,7 +1,7 @@
 // Copyright David Abrahams 2004. Distributed under the Boost
 // Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-#include "x.hpp"
+#include "movable.hpp"
 
 int f(X&);
 X g();

Deleted: sandbox/move/libs/move/test/x.hpp
==============================================================================
--- sandbox/move/libs/move/test/x.hpp 2009-01-06 03:17:08 EST (Tue, 06 Jan 2009)
+++ (empty file)
@@ -1,98 +0,0 @@
-// Copyright David Abrahams 2004. Distributed under the Boost
-// Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-#ifndef X_DWA2004410_HPP
-# define X_DWA2004410_HPP
-
-# include <boost/move/move.hpp>
-# include <boost/assert.hpp>
-# include "say.hpp"
-# include "./generic_tests.hpp"
-
-//
-// A sample movable class.
-//
-class X
-{
- public: // "Ordinary" stuff
- X() : resource(++cnt)
- {
- SAY("X() #" << resource);
- }
-
- X(X const& rhs) : resource(++cnt)
- {
- copy(rhs);
- }
-
- ~X()
- {
- release();
- }
-
- // Assign is declared in the move stuff
-
- public: // Move stuff
- // move constructor
- X(boost::move_from<X> rhs)
- : resource(rhs.source.resource)
- {
- BOOST_ASSERT(rhs.source.resource <= cnt); // check for garbage
- SAY("MOVE #" << resource);
- test::moved();
- rhs.source.resource = 0;
- BOOST_ASSERT(resource);
- }
-
- // move assignment
- X& operator=(X rhs)
- {
- BOOST_ASSERT(rhs.resource <= cnt); // check for garbage
- release();
- resource = rhs.resource;
- SAY("MOVE #" << resource);
- test::moved();
- rhs.resource = 0;
- BOOST_ASSERT(resource);
- return *this;
- }
-
- static int copies; // count the number of copies
-
- operator boost::move_from<X>() { return *this; }
-
- int value() const { return resource; }
-
- private: // helper functions
- void release()
- {
- BOOST_ASSERT(resource <= cnt); // check for garbage
- if (!resource)
- SAY("destroy empty");
- else
- SAY("destroy #" << resource);
- resource = 0;
- }
-
- void copy(X const& rhs)
- {
- BOOST_ASSERT(rhs.resource <= cnt); // check for garbage
- SAY("copy #" << this->resource << " <- #" << rhs.resource);
- test::copied();
- ++copies;
- }
-
- private: // Data members
- int resource;
-
- static int cnt; // count the number of resources
-};
-
-int X::cnt;
-int X::copies;
-
-struct X_source {
- X operator()() { return X(); }
-};
-
-#endif // X_DWA2004410_HPP

Deleted: sandbox/move/libs/move/test/y.hpp
==============================================================================
--- sandbox/move/libs/move/test/y.hpp 2009-01-06 03:17:08 EST (Tue, 06 Jan 2009)
+++ (empty file)
@@ -1,92 +0,0 @@
-// Copyright David Abrahams 2004. Distributed under the Boost
-// Copyright Daniel James 2008. Distributed under the Boost
-// Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-#ifndef Y_DWA2004410_HPP
-# define Y_DWA2004410_HPP
-
-# include <boost/move/move.hpp>
-# include <boost/assert.hpp>
-# include "say.hpp"
-# include "./generic_tests.hpp"
-
-//
-// A sample movable class.
-//
-class Y
-{
- Y(Y& rhs);
- public: // "Ordinary" stuff
- Y() : resource(++cnt)
- {
- SAY("Y() #" << resource);
- }
-
- ~Y()
- {
- release();
- }
-
- public: // Move stuff
- // move constructor
- Y(boost::move_from<Y> rhs)
- : resource(rhs.source.resource)
- {
- BOOST_ASSERT(rhs.source.resource <= cnt); // check for garbage
- SAY("MOVE #" << resource);
- test::moved();
- rhs.source.resource = 0;
- BOOST_ASSERT(resource);
- }
-
- // move assignment
- Y& operator=(Y rhs)
- {
- BOOST_ASSERT(rhs.resource <= cnt); // check for garbage
- release();
- resource = rhs.resource;
- SAY("MOVE #" << resource);
- test::moved();
- rhs.resource = 0;
- BOOST_ASSERT(resource);
- return *this;
- }
-
- operator boost::move_from<Y>()
- {
- return boost::move_from<Y>(*this);
- }
-
- int value() const { return resource; }
-
- static int copies; // count the number of copies
-
- private: // helper functions
- void release()
- {
- BOOST_ASSERT(resource <= cnt); // check for garbage
- if (!resource)
- SAY("destroy empty");
- else
- SAY("destroy #" << resource);
- resource = 0;
- }
-
- void copy(Y const& rhs)
- {
- BOOST_ASSERT(rhs.resource <= cnt); // check for garbage
- SAY("copy #" << this->resource << " <- #" << rhs.resource);
- test::copied();
- ++copies;
- }
-
- private: // Data members
- int resource;
-
- static int cnt; // count the number of resources
-};
-
-int Y::cnt;
-int Y::copies;
-
-#endif // Y_DWA2004410_HPP


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