Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r72413 - sandbox/conversion/libs/conversion_ext/test
From: vicente.botet_at_[hidden]
Date: 2011-06-05 12:47:38


Author: viboes
Date: 2011-06-05 12:47:37 EDT (Sun, 05 Jun 2011)
New Revision: 72413
URL: http://svn.boost.org/trac/boost/changeset/72413

Log:
Conversion: fix some bugs when enable is used
Text files modified:
   sandbox/conversion/libs/conversion_ext/test/array.cpp | 8 ++++++--
   sandbox/conversion/libs/conversion_ext/test/string.cpp | 7 +++++--
   sandbox/conversion/libs/conversion_ext/test/tuple.cpp | 3 +++
   sandbox/conversion/libs/conversion_ext/test/vector.cpp | 9 ++++++++-
   4 files changed, 22 insertions(+), 5 deletions(-)

Modified: sandbox/conversion/libs/conversion_ext/test/array.cpp
==============================================================================
--- sandbox/conversion/libs/conversion_ext/test/array.cpp (original)
+++ sandbox/conversion/libs/conversion_ext/test/array.cpp 2011-06-05 12:47:37 EDT (Sun, 05 Jun 2011)
@@ -13,6 +13,12 @@
 #include <iostream>
 #include <boost/detail/lightweight_test.hpp>
 #include "helper.hpp"
+#include <boost/static_assert.hpp>
+
+BOOST_STATIC_ASSERT(( !boost::conversion::default_converter_condition< boost::array<A1,3>, boost::array<B1,3> >::value));
+BOOST_STATIC_ASSERT(( boost::conversion::default_assigner_condition< boost::array<A1,3>, boost::array<B1,3> >::value));
+BOOST_STATIC_ASSERT(( boost::is_extrinsic_assignable< A1, B1 >::value));
+BOOST_STATIC_ASSERT(( boost::is_extrinsic_assignable< boost::array<A1,3>, boost::array<B1,3> >::value));
 
 using namespace boost;
 
@@ -26,8 +32,6 @@
     boost::array<int,3> bs;
     boost::array<short,3> as;
     boost::conversion::assign_to(as,bs);
-
-
 }
 
 int main( )

Modified: sandbox/conversion/libs/conversion_ext/test/string.cpp
==============================================================================
--- sandbox/conversion/libs/conversion_ext/test/string.cpp (original)
+++ sandbox/conversion/libs/conversion_ext/test/string.cpp 2011-06-05 12:47:37 EDT (Sun, 05 Jun 2011)
@@ -7,11 +7,11 @@
 // See http://www.boost.org/libs/synchro for documentation.
 //
 //////////////////////////////////////////////////////////////////////////////
+#include <iostream>
 
 #include <boost/conversion/convert_to.hpp>
 #include <boost/conversion/assign_to.hpp>
 #include <boost/conversion/std/string.hpp>
-#include <iostream>
 #include <boost/detail/lightweight_test.hpp>
 
 using namespace boost;
@@ -23,14 +23,17 @@
   bool b1=true;
   std::string str = boost::conversion::convert_to<std::string>(b1);
   bool b2=boost::conversion::convert_to<bool>(str);
+ BOOST_TEST(b2);
 
 }
 void explicit_assign_to() {
   bool b1=true;
   std::string str;
   boost::conversion::assign_to(str, b1);
- bool b2;
+
+ bool b2=false;
   boost::conversion::assign_to(b2, str);
+ BOOST_TEST(b2);
 }
 
 int main( )

Modified: sandbox/conversion/libs/conversion_ext/test/tuple.cpp
==============================================================================
--- sandbox/conversion/libs/conversion_ext/test/tuple.cpp (original)
+++ sandbox/conversion/libs/conversion_ext/test/tuple.cpp 2011-06-05 12:47:37 EDT (Sun, 05 Jun 2011)
@@ -15,6 +15,9 @@
 #include "helper.hpp"
 
 using namespace boost;
+#include <boost/static_assert.hpp>
+
+BOOST_STATIC_ASSERT(( !boost::conversion::default_converter_condition< fusion::tuple<A1,A2>, fusion::tuple<B1,B2> >::value));
 
 void explicit_convert_to() {
     B1 b1;

Modified: sandbox/conversion/libs/conversion_ext/test/vector.cpp
==============================================================================
--- sandbox/conversion/libs/conversion_ext/test/vector.cpp (original)
+++ sandbox/conversion/libs/conversion_ext/test/vector.cpp 2011-06-05 12:47:37 EDT (Sun, 05 Jun 2011)
@@ -18,7 +18,12 @@
 
 using namespace boost;
 
+BOOST_STATIC_ASSERT(( !boost::conversion::default_converter_condition< std::vector<A1>, std::vector<B1> >::value));
+BOOST_STATIC_ASSERT(( boost::conversion::default_assigner_condition< std::vector<A1>, std::vector<B1> >::value));
+BOOST_STATIC_ASSERT(( boost::is_extrinsic_assignable< A1, B1 >::value));
+BOOST_STATIC_ASSERT(( boost::is_extrinsic_assignable< std::vector<A1>, std::vector<B1> >::value));
 
+#if 0
 BOOST_STATIC_ASSERT((
     boost::is_same<
         boost::conversion::result_of::pack2<std::vector<B1,std::allocator<B1> > const, std::allocator<A1> const>::type,
@@ -29,6 +34,7 @@
>
>::value
     ));
+#endif
 
 void explicit_convert_to() {
     std::vector<B1> vb1;
@@ -41,6 +47,7 @@
     vb2[2]=b12;
     vb2[3]=b13;
     std::vector<A1> va2(boost::conversion::convert_to<std::vector<A1> >(vb2));
+#if 0
 
     std::allocator<A1> all;
     std::vector<A1,std::allocator<A1> > va3(
@@ -67,7 +74,7 @@
     std::vector<A1,std::allocator<A1> > va6(
         boost::conversion::convert_to<std::vector<A1,std::allocator<A1> > >(
             boost::conversion::pack(vb2, std::allocator<A1>())));
-
+#endif
 
 }
 void explicit_assign_to() {


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