|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r64711 - in sandbox/statistics/support/libs/assign/v2: src test/put test/unit_testing
From: erwann.rogard_at_[hidden]
Date: 2010-08-09 17:19:57
Author: e_r
Date: 2010-08-09 17:19:56 EDT (Mon, 09 Aug 2010)
New Revision: 64711
URL: http://svn.boost.org/trac/boost/changeset/64711
Log:
minor modifications
Text files modified:
sandbox/statistics/support/libs/assign/v2/src/main.cpp | 16 ++++++++--
sandbox/statistics/support/libs/assign/v2/test/put/modifier.cpp | 24 ++++++++++++++---
sandbox/statistics/support/libs/assign/v2/test/put/modifier.h | 2
sandbox/statistics/support/libs/assign/v2/test/put/put_wrapper.cpp | 54 ---------------------------------------
sandbox/statistics/support/libs/assign/v2/test/unit_testing/put.cpp | 14 +++++++--
5 files changed, 43 insertions(+), 67 deletions(-)
Modified: sandbox/statistics/support/libs/assign/v2/src/main.cpp
==============================================================================
--- sandbox/statistics/support/libs/assign/v2/src/main.cpp (original)
+++ sandbox/statistics/support/libs/assign/v2/src/main.cpp 2010-08-09 17:19:56 EDT (Mon, 09 Aug 2010)
@@ -5,8 +5,12 @@
#include <libs/assign/v2/test/detail/functor.h>
+#include <libs/assign/v2/test/put/modulo_op.h>
+#include <libs/assign/v2/test/put/ptr.h>
#include <libs/assign/v2/test/put/modifier.h>
-#include <libs/assign/v2/test/put/put_wrapper.h>
+#include <libs/assign/v2/test/put/tuple_refs.h>
+#include <libs/assign/v2/test/put/static.h>
+#include <libs/assign/v2/test/put/stl.h>
#include <libs/assign/v2/test/put_range/convert.h>
@@ -22,6 +26,7 @@
#include <libs/assign/v2/test/ref/wrapper.h>
#include <libs/assign/v2/example/tutorial.h>
+#include <libs/assign/v2/example/experimental.h>
int main (int argc, char * const argv[]) {
@@ -33,8 +38,11 @@
xxx_detail::xxx_functor::test();
- xxx_put::xxx_modifier::test();
- xxx_put::xxx_put_wrapper::test();
+ xxx_put::xxx_modulo_op::test();
+ xxx_put::xxx_ptr::test();
+ xxx_put::xxx_static::test();
+ xxx_put::xxx_stl::test();
+ xxx_put::xxx_tuple_refs::test();
xxx_put_range::xxx_convert::test();
@@ -43,7 +51,6 @@
xxx_ref::xxx_csv_anon::test();
xxx_ref::xxx_fusion_list::test();
xxx_ref::xxx_generic_anon::test();
- xxx_put::xxx_put_wrapper::test();
xxx_ref::xxx_wrapper::test();
xxx_type_traits::xxx_has_push::test();
@@ -53,6 +60,7 @@
{
using namespace example_assign_v2;
xxx_tutorial::run();
+ xxx_experimental::run();
}
return 0;
Modified: sandbox/statistics/support/libs/assign/v2/test/put/modifier.cpp
==============================================================================
--- sandbox/statistics/support/libs/assign/v2/test/put/modifier.cpp (original)
+++ sandbox/statistics/support/libs/assign/v2/test/put/modifier.cpp 2010-08-09 17:19:56 EDT (Mon, 09 Aug 2010)
@@ -7,6 +7,10 @@
// Boost Software License, Version 1.0. (See accompanying file //
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //
//////////////////////////////////////////////////////////////////////////////
+
+// TODO : the forward declarations are not sufficient as the default
+// arguments aren't specified. If they were, redefinition error. Is there
+// a better way?
#include <deque>
#include <list>
#include <map>
@@ -16,6 +20,11 @@
#include <vector>
#include <boost/array.hpp>
+#include <boost/ptr_container/ptr_array.hpp>
+#include <boost/ptr_container/ptr_deque.hpp>
+#include <boost/ptr_container/ptr_list.hpp>
+#include <boost/ptr_container/ptr_vector.hpp>
+
#include <boost/preprocessor/punctuation/comma_if.hpp>
#include <boost/preprocessor/control/expr_if.hpp>
#include <boost/assign/v2/detail/checking/assert.hpp>
@@ -39,14 +48,18 @@
using namespace boost::assign::v2;
{
typedef put_tag::push_back wanted_;
- LIBS_ASSIGN_V2_TEST_PUT_modifier( std::list, int, , 0 )
- LIBS_ASSIGN_V2_TEST_PUT_modifier( std::set, int, , 0 )
- LIBS_ASSIGN_V2_TEST_PUT_modifier( std::vector, int, , 0 )
- LIBS_ASSIGN_V2_TEST_PUT_modifier( std::deque, int, , 0 )
+ LIBS_ASSIGN_V2_TEST_PUT_modifier( std::list, int, , 0 )
+ LIBS_ASSIGN_V2_TEST_PUT_modifier( std::vector, int, , 0 )
+ LIBS_ASSIGN_V2_TEST_PUT_modifier( std::deque, int, , 0 )
+
+ LIBS_ASSIGN_V2_TEST_PUT_modifier( boost::ptr_deque, int, , 0 )
+ LIBS_ASSIGN_V2_TEST_PUT_modifier( boost::ptr_list, int, , 0 )
+ LIBS_ASSIGN_V2_TEST_PUT_modifier( boost::ptr_vector, int, , 0 )
}
{
typedef put_tag::at_next wanted_;
- LIBS_ASSIGN_V2_TEST_PUT_modifier(boost::array, int, 1, 1 )
+ LIBS_ASSIGN_V2_TEST_PUT_modifier( boost::array, int, 1, 1 )
+ LIBS_ASSIGN_V2_TEST_PUT_modifier( boost::ptr_array, int, 1, 1 )
}
{
typedef put_tag::push wanted_;
@@ -55,6 +68,7 @@
}
{
typedef put_tag::insert wanted_;
+ LIBS_ASSIGN_V2_TEST_PUT_modifier( std::set, int, , 0 )
LIBS_ASSIGN_V2_TEST_PUT_modifier( std::map, const char*, int, 1 )
}
Modified: sandbox/statistics/support/libs/assign/v2/test/put/modifier.h
==============================================================================
--- sandbox/statistics/support/libs/assign/v2/test/put/modifier.h (original)
+++ sandbox/statistics/support/libs/assign/v2/test/put/modifier.h 2010-08-09 17:19:56 EDT (Mon, 09 Aug 2010)
@@ -16,7 +16,7 @@
void test();
-}// modifier
+}// xxx_modifier
}// xxx_put
}// xxx_test_assign
Modified: sandbox/statistics/support/libs/assign/v2/test/put/put_wrapper.cpp
==============================================================================
--- sandbox/statistics/support/libs/assign/v2/test/put/put_wrapper.cpp (original)
+++ sandbox/statistics/support/libs/assign/v2/test/put/put_wrapper.cpp 2010-08-09 17:19:56 EDT (Mon, 09 Aug 2010)
@@ -24,59 +24,7 @@
void test()
{
- using namespace boost::assign::v2;
- using namespace checking::constants;
- namespace chk_cont = checking::container;
- {
- // Array
- typedef boost::array<int,8> cont_;
- cont_ cont;
- chk_cont::do_check(
- put( cont )
- ( a )( b )( c )( d )( e )( f )( g )( h ).unwrap()
- );
- }
- { // Queue
- typedef std::queue<int> cont_;
- cont_ cont;
- ( put( cont ) % (_repeat = 3 ) ) (-1);
- BOOST_ASSIGN_V2_CHECK_EQUAL( cont.front(), -1); cont.pop();
- BOOST_ASSIGN_V2_CHECK_EQUAL( cont.front(), -1); cont.pop();
- BOOST_ASSIGN_V2_CHECK_EQUAL( cont.front(), -1); cont.pop();
- BOOST_ASSIGN_V2_CHECK_EQUAL( cont.empty(), true);
- }
- {
- int a1, b1, c1, d1;//, e1, f1, g1, h1;
- {
- a1 = a; b1 = b; c1 = c;
- d1 = d;
- }
- { // Deque + tuple
- typedef boost::tuple<int&, const int&> tuple_;
- typedef std::deque<tuple_> cont_;
- {
- cont_ cont;
- put( cont )( a1 , b1 )( c1 , d1 );
- BOOST_ASSIGN_V2_CHECK_EQUAL( &a1, &boost::get<0>( cont[0] ) );
- BOOST_ASSIGN_V2_CHECK_EQUAL( &b1, &boost::get<1>( cont[0] ) );
- BOOST_ASSIGN_V2_CHECK_EQUAL( &c1, &boost::get<0>( cont[1] ) );
- BOOST_ASSIGN_V2_CHECK_EQUAL( &d1, &boost::get<1>( cont[1] ) );
- }
- }
- {
- // Map
- typedef std::map<const char*, int> cont_;
- cont_ cont;
- put( cont )( "x", 2 )( "y", 1 );
- }
- { // Map
- typedef std::map<const char*, int> cont_;
- cont_ cont;
- ( put( cont ) % _incr_lookup).csv( "x", "y", "x" );
- BOOST_ASSIGN_V2_CHECK_EQUAL( 2, cont["x"] );
- BOOST_ASSIGN_V2_CHECK_EQUAL( 1, cont["y"] );
- }
- }
+ // TODO remove
}
Modified: sandbox/statistics/support/libs/assign/v2/test/unit_testing/put.cpp
==============================================================================
--- sandbox/statistics/support/libs/assign/v2/test/unit_testing/put.cpp (original)
+++ sandbox/statistics/support/libs/assign/v2/test/unit_testing/put.cpp 2010-08-09 17:19:56 EDT (Mon, 09 Aug 2010)
@@ -14,8 +14,11 @@
#include <boost/test/test_tools.hpp>
#define BOOST_ASSIGN_CHECK_EQUAL(a,b) BOOST_CHECK_EQUAL(a,b)
-#include <libs/assign/v2/test/put/put_wrapper.cpp>
-#include <libs/assign/v2/test/put/modifier.cpp>
+#include <libs/assign/v2/test/put/modulo_op.cpp>
+#include <libs/assign/v2/test/put/ptr.cpp>
+#include <libs/assign/v2/test/put/static.cpp>
+#include <libs/assign/v2/test/put/stl.cpp>
+#include <libs/assign/v2/test/put/tuple_refs.cpp>
#include <boost/test/unit_test.hpp>
using boost::unit_test::test_suite;
@@ -25,8 +28,11 @@
using namespace test_assign_v2;
{
using namespace xxx_put;
- test->add( BOOST_TEST_CASE( &xxx_put_wrapper::test ) );
- test->add( BOOST_TEST_CASE( &xxx_modifier::test ) );
+ test->add( BOOST_TEST_CASE( &xxx_modulo_op::test ) );
+ test->add( BOOST_TEST_CASE( &xxx_ptr::test ) );
+ test->add( BOOST_TEST_CASE( &xxx_static::test ) );
+ test->add( BOOST_TEST_CASE( &xxx_stl::test ) );
+ test->add( BOOST_TEST_CASE( &xxx_tuple_refs::test ) );
}
return test;
}
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