Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r73258 - in sandbox/opaque/libs/opaque/test: . new_class
From: vicente.botet_at_[hidden]
Date: 2011-07-20 12:32:52


Author: viboes
Date: 2011-07-20 12:32:51 EDT (Wed, 20 Jul 2011)
New Revision: 73258
URL: http://svn.boost.org/trac/boost/changeset/73258

Log:
Opaque: Avoid dependency on Boost.Conversion
Text files modified:
   sandbox/opaque/libs/opaque/test/Jamfile.v2 | 1 +
   sandbox/opaque/libs/opaque/test/new_class/using_plus_assign_pass.cpp | 31 ++++++++++++++++++++++++++-----
   2 files changed, 27 insertions(+), 5 deletions(-)

Modified: sandbox/opaque/libs/opaque/test/Jamfile.v2
==============================================================================
--- sandbox/opaque/libs/opaque/test/Jamfile.v2 (original)
+++ sandbox/opaque/libs/opaque/test/Jamfile.v2 2011-07-20 12:32:51 EDT (Wed, 20 Jul 2011)
@@ -40,6 +40,7 @@
         <toolset>gcc-mingw-4.5.0:<cxxflags>-Wno-missing-field-initializers
         <toolset>gcc-mingw-4.5.0:<cxxflags>-fdiagnostics-show-option
         <toolset>msvc:<cxxflags>/wd4127
+ <define>BOOST_OPAQUE_NOT_DEPENDS_ON_CONVERSION
     ;
 
    test-suite "new"

Modified: sandbox/opaque/libs/opaque/test/new_class/using_plus_assign_pass.cpp
==============================================================================
--- sandbox/opaque/libs/opaque/test/new_class/using_plus_assign_pass.cpp (original)
+++ sandbox/opaque/libs/opaque/test/new_class/using_plus_assign_pass.cpp 2011-07-20 12:32:51 EDT (Wed, 20 Jul 2011)
@@ -50,16 +50,37 @@
     BOOST_TEST(sizeof(NT)==sizeof(UT));
 }
 
-void plus_assign_test() {
- NT a1(1), b2(2), c2(2);
- a1+=b2;
- BOOST_TEST(a1.underlying()==3);
+void same_test() {
+ NT x(1);
+ NT y(2);
+ NT &z=(x+=y);
+ BOOST_TEST(x.underlying()==3);
+ BOOST_TEST(&x == &z);
 }
 
+#if 0
+void ut1_test() {
+ NT x(1);
+ NT &z=(x+=2);
+ BOOST_TEST(x.underlying()==3);
+ BOOST_TEST(&x == &z);
+}
+
+void ut2_test() {
+ UT x = 1;
+ NT y(2);
+ UT &z=(x+=y);
+ BOOST_TEST(x.underlying()==3);
+ BOOST_TEST(&x == &z);
+}
+#endif
+
 int main()
 {
   size_test();
- plus_assign_test();
+ same_test();
+ //ut1_test();
+ //ut2_test();
 
   return boost::report_errors();
 }


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