Boost logo

Boost-Commit :

From: daniel_james_at_[hidden]
Date: 2008-04-14 07:13:00


Author: danieljames
Date: 2008-04-14 07:13:00 EDT (Mon, 14 Apr 2008)
New Revision: 44409
URL: http://svn.boost.org/trac/boost/changeset/44409

Log:
Use Boost.Test's minimal testing facility.
Text files modified:
   sandbox/move/libs/move/test/Jamfile.v2 | 4 ++--
   sandbox/move/libs/move/test/main.cpp | 14 +++++++++++---
   sandbox/move/libs/move/test/move_test.cpp | 9 ++++-----
   sandbox/move/libs/move/test/no_sfinae_test.cpp | 14 +++++++++-----
   4 files changed, 26 insertions(+), 15 deletions(-)

Modified: sandbox/move/libs/move/test/Jamfile.v2
==============================================================================
--- sandbox/move/libs/move/test/Jamfile.v2 (original)
+++ sandbox/move/libs/move/test/Jamfile.v2 2008-04-14 07:13:00 EDT (Mon, 14 Apr 2008)
@@ -2,10 +2,10 @@
 project boost/move ;
 
 test-suite "move-suite" :
- [ run main.cpp /boost/unit_test//boost_unit_test_framework ]
+ [ run main.cpp ]
     [ run move.cpp ]
     [ run move_test.cpp ]
- [ run no_sfinae_test.cpp /boost/unit_test//boost_unit_test_framework ]
+ [ run no_sfinae_test.cpp ]
 ;
 
 test-suite "move-fail" :

Modified: sandbox/move/libs/move/test/main.cpp
==============================================================================
--- sandbox/move/libs/move/test/main.cpp (original)
+++ sandbox/move/libs/move/test/main.cpp 2008-04-14 07:13:00 EDT (Mon, 14 Apr 2008)
@@ -6,8 +6,7 @@
 
 /*************************************************************************************************/
 
-#define BOOST_TEST_MAIN
-#include <boost/test/unit_test.hpp>
+#include <boost/test/minimal.hpp>
 
 #include <iterator>
 #include <vector>
@@ -20,6 +19,10 @@
 
 /*************************************************************************************************/
 
+#define BOOST_CHECK_EQUAL(x, y) BOOST_CHECK(x == y)
+
+/*************************************************************************************************/
+
 // Taken from adobe::destroy
 
 template <typename T> // T models Regular
@@ -36,7 +39,7 @@
 
 /*************************************************************************************************/
 
-BOOST_AUTO_TEST_CASE(move_test)
+void move_test()
 {
     typedef test_vector<int> vector_t;
     typedef test_vector<vector_t> vector_vector_t;
@@ -116,3 +119,8 @@
         BOOST_CHECK_EQUAL(addr, x[0].begin());
     }
 }
+
+int test_main(int, char**) {
+ move_test();
+ return 0;
+}
\ No newline at end of file

Modified: sandbox/move/libs/move/test/move_test.cpp
==============================================================================
--- sandbox/move/libs/move/test/move_test.cpp (original)
+++ sandbox/move/libs/move/test/move_test.cpp 2008-04-14 07:13:00 EDT (Mon, 14 Apr 2008)
@@ -15,7 +15,7 @@
 // without express or implied warranty.
 
 #include <boost/move.hpp>
-#include <boost/assert.hpp>
+#include <boost/test/minimal.hpp>
 #include <boost/utility.hpp> // for boost::noncopyable
 
 #include <cstdlib> // for size_t
@@ -63,8 +63,7 @@
         if (str_ != 0)
             std::strncpy(str_, x.str_, len_);
         
- // We should never copy the string in these tests.
- BOOST_ASSERT(false);
+ BOOST_ERROR("The moveable_string should not be copied in this test.");
     }
     
     moveable_string(boost::move_from<moveable_string> x)
@@ -169,10 +168,10 @@
 //////////////////////////////////////////////////////////////////////////
 // function test_main
 //
-int main( int, char *[] )
+int test_main( int, char *[] )
 {
     moveable_string sink(source());
- BOOST_ASSERT( sink == "abcdefg" );
+ BOOST_CHECK( sink == "abcdefg" );
 
     return 0;
 }

Modified: sandbox/move/libs/move/test/no_sfinae_test.cpp
==============================================================================
--- sandbox/move/libs/move/test/no_sfinae_test.cpp (original)
+++ sandbox/move/libs/move/test/no_sfinae_test.cpp 2008-04-14 07:13:00 EDT (Mon, 14 Apr 2008)
@@ -10,9 +10,7 @@
 // Is this worth supporting?
 
 #include <boost/move.hpp>
-
-#define BOOST_TEST_MAIN
-#include <boost/test/unit_test.hpp>
+#include <boost/test/minimal.hpp>
 #include "./vector.hpp"
 
 struct movable {
@@ -37,7 +35,7 @@
     struct is_movable< ::test_vector<T> > : public boost::mpl::true_ {};
 }
 
-BOOST_AUTO_TEST_CASE(move_test)
+void move_test()
 {
     BOOST_CHECK(boost::is_movable< ::movable >::value);
 
@@ -47,5 +45,11 @@
     int* ptr = &x[0];
 
     test_vector<int> y(boost::move(x));
- BOOST_CHECK_EQUAL(ptr, &y[0]);
+ BOOST_CHECK(ptr == &y[0]);
+}
+
+int test_main(int, char**) {
+ move_test();
+
+ return 0;
 }


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