Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r64713 - sandbox/statistics/support/libs/assign/v2/test/put
From: erwann.rogard_at_[hidden]
Date: 2010-08-09 17:23:34


Author: e_r
Date: 2010-08-09 17:23:33 EDT (Mon, 09 Aug 2010)
New Revision: 64713
URL: http://svn.boost.org/trac/boost/changeset/64713

Log:
dir test organizational change
Added:
   sandbox/statistics/support/libs/assign/v2/test/put/modulo_op.cpp (contents, props changed)
   sandbox/statistics/support/libs/assign/v2/test/put/modulo_op.h (contents, props changed)
   sandbox/statistics/support/libs/assign/v2/test/put/ptr.cpp (contents, props changed)
   sandbox/statistics/support/libs/assign/v2/test/put/ptr.h (contents, props changed)
   sandbox/statistics/support/libs/assign/v2/test/put/static.cpp (contents, props changed)
   sandbox/statistics/support/libs/assign/v2/test/put/static.h (contents, props changed)
   sandbox/statistics/support/libs/assign/v2/test/put/stl.cpp (contents, props changed)
   sandbox/statistics/support/libs/assign/v2/test/put/stl.h (contents, props changed)
   sandbox/statistics/support/libs/assign/v2/test/put/tuple_refs.cpp (contents, props changed)
   sandbox/statistics/support/libs/assign/v2/test/put/tuple_refs.h (contents, props changed)

Added: sandbox/statistics/support/libs/assign/v2/test/put/modulo_op.cpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/support/libs/assign/v2/test/put/modulo_op.cpp 2010-08-09 17:23:33 EDT (Mon, 09 Aug 2010)
@@ -0,0 +1,56 @@
+//////////////////////////////////////////////////////////////////////////////
+// Boost.Assign v2 //
+// //
+// Copyright (C) 2003-2004 Thorsten Ottosen //
+// Copyright (C) 2010 Erwann Rogard //
+// Use, modification and distribution are subject to 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 <queue>
+#include <map>
+#include <boost/assign/v2/detail/checking/container.hpp>
+#include <boost/assign/v2/detail/checking/constants.hpp>
+#include <boost/assign/v2/put/put.hpp>
+#include <libs/assign/v2/test/put/modulo_op.h>
+
+namespace test_assign_v2{
+namespace xxx_put{
+namespace xxx_modulo_op{
+
+ void test()
+ {
+ using namespace boost::assign::v2;
+ using namespace checking::constants;
+ namespace chk_cont = checking::container;
+ { // Queue + Repeat
+ 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);
+ }
+ { // Map + IncrLookup
+ {
+ typedef std::map<const char*, int> cont_;
+ cont_ cont;
+ put( cont )( "x", 2 )( "y", 1 );
+ }
+ {
+ 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"] );
+ }
+ }
+ }
+
+
+}// xxx_modulo_op
+}// xxx_put
+}// test_assign_v2
+
+

Added: sandbox/statistics/support/libs/assign/v2/test/put/modulo_op.h
==============================================================================
--- (empty file)
+++ sandbox/statistics/support/libs/assign/v2/test/put/modulo_op.h 2010-08-09 17:23:33 EDT (Mon, 09 Aug 2010)
@@ -0,0 +1,23 @@
+//////////////////////////////////////////////////////////////////////////////
+// Boost.Assign v2 //
+// //
+// Copyright (C) 2003-2004 Thorsten Ottosen //
+// Copyright (C) 2010 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_ASSIGN_V2_CHAIN_TEST_PUT_MODULO_OP_ER_2010_H
+#define BOOST_ASSIGN_V2_CHAIN_TEST_PUT_MODULO_OP_ER_2010_H
+
+namespace test_assign_v2{
+namespace xxx_put{
+namespace xxx_modulo_op{
+
+ void test();
+
+}// xxx_modulo_op
+}// xxx_put
+}// xxx_test_assign
+
+#endif

Added: sandbox/statistics/support/libs/assign/v2/test/put/ptr.cpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/support/libs/assign/v2/test/put/ptr.cpp 2010-08-09 17:23:33 EDT (Mon, 09 Aug 2010)
@@ -0,0 +1,90 @@
+//////////////////////////////////////////////////////////////////////////////
+// Boost.Assign v2 //
+// //
+// Copyright (C) 2003-2004 Thorsten Ottosen //
+// Copyright (C) 2010 Erwann Rogard //
+// Use, modification and distribution are subject to 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 <boost/detail/workaround.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/assign/v2/detail/checking/constants.hpp>
+#include <boost/assign/v2/detail/checking/container.hpp>
+#include <boost/assign/v2/v2.hpp>
+
+#include <libs/assign/v2/test/put/ptr.h>
+
+namespace test_assign_v2{
+namespace xxx_put{
+namespace xxx_ptr{
+
+ void test(){
+ using namespace boost::assign::v2;
+ { // Array
+
+ {
+ typedef boost::ptr_array<int,8> cont_;
+ cont_ cont;
+ {
+ using namespace checking::constants;
+ // TODO
+ //put( cont )( a )( b )( c )( d )( e )( f )( g )( h );
+ }
+ {
+ using namespace checking::container;
+ //do_check( cont );
+ }
+ }
+ }
+ { // Sequence
+
+ {
+ typedef boost::ptr_deque<int> cont_;
+ cont_ cont;
+ {
+ using namespace checking::constants;
+ put( cont )( a )( b )( c )( d )( e )( f )( g )( h );
+ }
+ {
+ using namespace checking::container;
+ do_check( cont );
+ }
+ }// ptr_deque
+ {
+ typedef boost::ptr_list<int> cont_;
+ cont_ cont;
+ {
+ using namespace checking::constants;
+ put( cont )( a )( b )( c )( d )( e )( f )( g )( h );
+ }
+ {
+ using namespace checking::container;
+ do_check( cont );
+ }
+ }// ptr_list
+ {
+ typedef boost::ptr_vector<int> cont_;
+ cont_ cont;
+ {
+ using namespace checking::constants;
+ put( cont )( a )( b )( c )( d )( e )( f )( g )( h );
+ }
+ {
+ using namespace checking::container;
+ do_check( cont );
+ }
+ }// ptr_vector
+
+ }
+
+ }
+
+}// xxx_ptr
+}// xxx_put
+}// xxx_test_assign
+

Added: sandbox/statistics/support/libs/assign/v2/test/put/ptr.h
==============================================================================
--- (empty file)
+++ sandbox/statistics/support/libs/assign/v2/test/put/ptr.h 2010-08-09 17:23:33 EDT (Mon, 09 Aug 2010)
@@ -0,0 +1,23 @@
+//////////////////////////////////////////////////////////////////////////////
+// Boost.Assign v2 //
+// //
+// Copyright (C) 2003-2004 Thorsten Ottosen //
+// Copyright (C) 2010 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_ASSIGN_V2_CHAIN_TEST_PUT_PTR_ER_2010_H
+#define BOOST_ASSIGN_V2_CHAIN_TEST_PUT_PTR_ER_2010_H
+
+namespace test_assign_v2{
+namespace xxx_put{
+namespace xxx_ptr{
+
+ void test();
+
+}// xxx_ptr
+}// xxx_put
+}// xxx_test_assign
+
+#endif

Added: sandbox/statistics/support/libs/assign/v2/test/put/static.cpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/support/libs/assign/v2/test/put/static.cpp 2010-08-09 17:23:33 EDT (Mon, 09 Aug 2010)
@@ -0,0 +1,82 @@
+//////////////////////////////////////////////////////////////////////////////
+// Boost.Assign v2 //
+// //
+// Copyright (C) 2003-2004 Thorsten Ottosen //
+// Copyright (C) 2010 Erwann Rogard //
+// Use, modification and distribution are subject to 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) //
+//////////////////////////////////////////////////////////////////////////////
+
+// 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>
+#include <queue>
+#include <set>
+#include <stack>
+#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>
+#include <boost/assign/v2/put/modifier/modifier.hpp>
+#include <libs/assign/v2/test/put/static.h>
+
+namespace test_assign_v2{
+namespace xxx_put{
+namespace xxx_static{
+
+#define LIBS_ASSIGN_V2_TEST_PUT_static( V, T0, T1, n )\
+ { \
+ typedef V< T0 BOOST_PP_COMMA_IF(n) BOOST_PP_EXPR_IF(n, T1) > cont_; \
+ typedef put_aux::deduce_modifier<cont_>::type found_; \
+ checking::do_assert_is_same<found_,wanted_>(); \
+ } \
+/**/
+
+ void test()
+ {
+ using namespace boost::assign::v2;
+ {
+ typedef put_tag::push_back wanted_;
+ LIBS_ASSIGN_V2_TEST_PUT_static( std::list, int, , 0 )
+ LIBS_ASSIGN_V2_TEST_PUT_static( std::vector, int, , 0 )
+ LIBS_ASSIGN_V2_TEST_PUT_static( std::deque, int, , 0 )
+
+ LIBS_ASSIGN_V2_TEST_PUT_static( boost::ptr_deque, int, , 0 )
+ LIBS_ASSIGN_V2_TEST_PUT_static( boost::ptr_list, int, , 0 )
+ LIBS_ASSIGN_V2_TEST_PUT_static( boost::ptr_vector, int, , 0 )
+ }
+ {
+ typedef put_tag::at_next wanted_;
+ LIBS_ASSIGN_V2_TEST_PUT_static( boost::array, int, 1, 1 )
+ LIBS_ASSIGN_V2_TEST_PUT_static( boost::ptr_array, int, 1, 1 )
+ }
+ {
+ typedef put_tag::push wanted_;
+ LIBS_ASSIGN_V2_TEST_PUT_static( std::queue, int, , 0 )
+ LIBS_ASSIGN_V2_TEST_PUT_static( std::stack, int, , 0 )
+ }
+ {
+ typedef put_tag::insert wanted_;
+ LIBS_ASSIGN_V2_TEST_PUT_static( std::set, int, , 0 )
+ LIBS_ASSIGN_V2_TEST_PUT_static( std::map, const char*, int, 1 )
+ }
+
+ }
+
+#undef LIBS_ASSIGN_V2_TEST_PUT_static
+
+}// xxx_static
+}// xxx_put
+}// test_assign_v2
+

Added: sandbox/statistics/support/libs/assign/v2/test/put/static.h
==============================================================================
--- (empty file)
+++ sandbox/statistics/support/libs/assign/v2/test/put/static.h 2010-08-09 17:23:33 EDT (Mon, 09 Aug 2010)
@@ -0,0 +1,23 @@
+//////////////////////////////////////////////////////////////////////////////
+// Boost.Assign v2 //
+// //
+// Copyright (C) 2003-2004 Thorsten Ottosen //
+// Copyright (C) 2010 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_ASSIGN_V2_CHAIN_TEST_PUT_STATIC_ER_2010_H
+#define BOOST_ASSIGN_V2_CHAIN_TEST_PUT_STATIC_ER_2010_H
+
+namespace test_assign_v2{
+namespace xxx_put{
+namespace xxx_static{
+
+ void test();
+
+}// xxx_static
+}// xxx_put
+}// xxx_test_assign
+
+#endif

Added: sandbox/statistics/support/libs/assign/v2/test/put/stl.cpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/support/libs/assign/v2/test/put/stl.cpp 2010-08-09 17:23:33 EDT (Mon, 09 Aug 2010)
@@ -0,0 +1,150 @@
+//////////////////////////////////////////////////////////////////////////////
+// Boost.Assign v2 //
+// //
+// Copyright (C) 2003-2004 Thorsten Ottosen //
+// Copyright (C) 2010 Erwann Rogard //
+// Use, modification and distribution are subject to 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 <boost/detail/workaround.hpp>
+
+#include <boost/array.hpp>
+#include <deque>
+#include <list>
+#include <map>
+#include <queue>
+#include <set>
+#include <stack>
+#include <vector>
+
+#include <boost/assign/v2/detail/checking/constants.hpp>
+#include <boost/assign/v2/detail/checking/container.hpp>
+#include <boost/assign/v2/v2.hpp>
+
+#include <libs/assign/v2/test/put/stl.h>
+
+namespace test_assign_v2{
+namespace xxx_put{
+namespace xxx_stl{
+
+ void test(){
+ using namespace boost::assign::v2;
+ { // Array
+
+ {
+ typedef boost::array<int,8> cont_;
+ cont_ cont;
+ {
+ using namespace checking::constants;
+ put( cont )( a )( b )( c )( d )( e )( f )( g )( h );
+ }
+ {
+ using namespace checking::container;
+ do_check( cont );
+ }
+ }
+ }
+ { // Associative
+
+ {
+ typedef std::map<int,int> cont_;
+ cont_ cont;
+ {
+ using namespace checking::container;
+ using namespace checking::constants;
+ do_check(
+ put( cont )
+ ( a, a )( b, b )( c, c )
+ ( d, d )( e, e )( f, f )
+ ( g, g )( h, h ).unwrap()
+ );
+ }
+ }// map
+ {
+ typedef std::set<int> cont_;
+ cont_ cont;
+ {
+ using namespace checking::container;
+ using namespace checking::constants;
+ do_check(
+ put( cont )
+ ( a )( b )( c )
+ ( d )( e )( f )
+ ( g )( h ).unwrap()
+ );
+ }
+ }// map
+ }// Associative
+ {
+ // Sequence
+ {
+ typedef std::deque<int> cont_;
+ cont_ cont;
+ {
+ using namespace checking::constants;
+ using namespace checking::container;
+ do_check(
+ put( cont )
+ ( a )( b )( c )( d )( e )( f )( g )( h ).unwrap()
+ );
+ }
+ }// deque
+ {
+ typedef std::list<int> cont_;
+ cont_ cont;
+ {
+ using namespace checking::constants;
+ using namespace checking::container;
+ do_check(
+ put( cont )
+ ( a )( b )( c )( d )( e )( f )( g )( h ).unwrap()
+ );
+ }
+ }// list
+ {
+ typedef std::vector<int> cont_;
+ cont_ cont;
+ {
+ using namespace checking::constants;
+ using namespace checking::container;
+ do_check(
+ put( cont )
+ ( a )( b )( c )( d )( e )( f )( g )( h ).unwrap()
+ );
+ }
+ }// vector
+ } // Sequence
+ {
+ // Push
+ {
+ typedef std::queue<int> cont_;
+ cont_ cont;
+ {
+ using namespace checking::constants;
+ using namespace checking::container;
+ do_check(
+ put( cont )
+ ( a )( b )( c )( d )( e )( f )( g )( h ).unwrap()
+ );
+ }
+ }// queue
+ // Push
+ {
+ typedef std::stack<int> cont_;
+ cont_ cont;
+ {
+ using namespace checking::constants;
+ using namespace checking::container;
+ do_check(
+ put( cont )
+ ( a )( b )( c )( d )( e )( f )( g )( h ).unwrap()
+ );
+ }
+ }// queue
+ }// Push
+ }// test()
+
+}// xxx_stl
+}// xxx_put
+}// xxx_test_assign

Added: sandbox/statistics/support/libs/assign/v2/test/put/stl.h
==============================================================================
--- (empty file)
+++ sandbox/statistics/support/libs/assign/v2/test/put/stl.h 2010-08-09 17:23:33 EDT (Mon, 09 Aug 2010)
@@ -0,0 +1,23 @@
+//////////////////////////////////////////////////////////////////////////////
+// Boost.Assign v2 //
+// //
+// Copyright (C) 2003-2004 Thorsten Ottosen //
+// Copyright (C) 2010 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_ASSIGN_V2_CHAIN_TEST_PUT_STL_ER_2010_H
+#define BOOST_ASSIGN_V2_CHAIN_TEST_PUT_STL_ER_2010_H
+
+namespace test_assign_v2{
+namespace xxx_put{
+namespace xxx_stl{
+
+ void test();
+
+}// xxx_stl
+}// xxx_put
+}// xxx_test_assign
+
+#endif

Added: sandbox/statistics/support/libs/assign/v2/test/put/tuple_refs.cpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/support/libs/assign/v2/test/put/tuple_refs.cpp 2010-08-09 17:23:33 EDT (Mon, 09 Aug 2010)
@@ -0,0 +1,51 @@
+//////////////////////////////////////////////////////////////////////////////
+// Boost.Assign v2 //
+// //
+// Copyright (C) 2003-2004 Thorsten Ottosen //
+// Copyright (C) 2010 Erwann Rogard //
+// Use, modification and distribution are subject to 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 <deque>
+#include <boost/tuple/tuple.hpp>
+#include <boost/assign/v2/detail/checking/container.hpp>
+#include <boost/assign/v2/detail/checking/constants.hpp>
+#include <boost/assign/v2/put/put.hpp>
+#include <libs/assign/v2/test/put/tuple_refs.h>
+
+namespace test_assign_v2{
+namespace xxx_put{
+namespace xxx_tuple_refs{
+
+ void test()
+ {
+ using namespace boost::assign::v2;
+ using namespace checking::constants;
+ namespace chk_cont = checking::container;
+ {
+ 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] ) );
+ }
+ }
+ }
+ }
+
+
+}// xxx_tuple_refs
+}// xxx_put
+}// test_assign_v2
+

Added: sandbox/statistics/support/libs/assign/v2/test/put/tuple_refs.h
==============================================================================
--- (empty file)
+++ sandbox/statistics/support/libs/assign/v2/test/put/tuple_refs.h 2010-08-09 17:23:33 EDT (Mon, 09 Aug 2010)
@@ -0,0 +1,23 @@
+//////////////////////////////////////////////////////////////////////////////
+// Boost.Assign v2 //
+// //
+// Copyright (C) 2003-2004 Thorsten Ottosen //
+// Copyright (C) 2010 Erwann Rogard //
+// Use, modification and distribution are subject to 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 BOOST_ASSIGN_V2_CHAIN_TEST_PUT_TUPLE_REFS_ER_2010_H
+#define BOOST_ASSIGN_V2_CHAIN_TEST_PUT_TUPLE_REFS_ER_2010_H
+
+namespace test_assign_v2{
+namespace xxx_put{
+namespace xxx_tuple_refs{
+
+ void test();
+
+}// xxx_tuple_refs
+}// xxx_put
+}// xxx_test_assign
+
+#endif


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