Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r68498 - sandbox/assign_v2/libs/assign/v2/test/put
From: erwann.rogard_at_[hidden]
Date: 2011-01-27 18:25:32


Author: e_r
Date: 2011-01-27 18:25:24 EST (Thu, 27 Jan 2011)
New Revision: 68498
URL: http://svn.boost.org/trac/boost/changeset/68498

Log:
upd assign_v2
Added:
   sandbox/assign_v2/libs/assign/v2/test/put/container.cpp (contents, props changed)
   sandbox/assign_v2/libs/assign/v2/test/put/container.h (contents, props changed)
   sandbox/assign_v2/libs/assign/v2/test/put/deduce.cpp (contents, props changed)
   sandbox/assign_v2/libs/assign/v2/test/put/deduce.h (contents, props changed)
   sandbox/assign_v2/libs/assign/v2/test/put/ext.cpp (contents, props changed)
   sandbox/assign_v2/libs/assign/v2/test/put/ext.h (contents, props changed)
   sandbox/assign_v2/libs/assign/v2/test/put/std.cpp (contents, props changed)
   sandbox/assign_v2/libs/assign/v2/test/put/std.h (contents, props changed)

Added: sandbox/assign_v2/libs/assign/v2/test/put/container.cpp
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/libs/assign/v2/test/put/container.cpp 2011-01-27 18:25:24 EST (Thu, 27 Jan 2011)
@@ -0,0 +1,28 @@
+//////////////////////////////////////////////////////////////////////////////
+// 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 <libs/assign/v2/test/put/container/functor.h>
+#include <libs/assign/v2/test/put/container/csv.h>
+#include <libs/assign/v2/test/put/container.h>
+
+
+namespace test_assign_v2{
+namespace xxx_put{
+namespace xxx_container{
+
+ void test()
+ {
+ xxx_functor::test();
+ xxx_csv::test();
+ }
+
+}// xxx_container
+}// xxx_put
+}// xxx_test_assign
+

Added: sandbox/assign_v2/libs/assign/v2/test/put/container.h
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/libs/assign/v2/test/put/container.h 2011-01-27 18:25:24 EST (Thu, 27 Jan 2011)
@@ -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 LIBS_ASSIGN_V2_TEST_PUT_CONTAINER_ER_2010_H
+#define LIBS_ASSIGN_V2_TEST_PUT_CONTAINER_ER_2010_H
+
+namespace test_assign_v2{
+namespace xxx_put{
+namespace xxx_container{
+
+ void test();
+
+}// xxx_container
+}// xxx_put
+}// xxx_test_assign
+
+#endif

Added: sandbox/assign_v2/libs/assign/v2/test/put/deduce.cpp
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/libs/assign/v2/test/put/deduce.cpp 2011-01-27 18:25:24 EST (Thu, 27 Jan 2011)
@@ -0,0 +1,77 @@
+//////////////////////////////////////////////////////////////////////////////
+// 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 <list>
+#include <map>
+#include <queue>
+#include <set>
+#include <stack>
+#include <vector>
+#include <string>
+#include <boost/array.hpp>
+#include <boost/type_traits/is_same.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/put/deduce.hpp>
+#include <libs/assign/v2/test/put/deduce.h>
+
+namespace test_assign_v2{
+namespace xxx_put{
+namespace xxx_deduce{
+
+ void test()
+ {
+ namespace as2 = boost::assign::v2;
+ {
+ typedef as2::modifier_tag::push_back wanted_;
+ as2::put_aux::check_deduce<std::deque<int>, wanted_>();
+ as2::put_aux::check_deduce<std::list<int>, wanted_>();
+ as2::put_aux::check_deduce<std::vector<int>, wanted_>();
+
+ as2::put_aux::check_deduce<boost::ptr_deque<int>, wanted_>();
+ as2::put_aux::check_deduce<boost::ptr_list<int>, wanted_>();
+ as2::put_aux::check_deduce<boost::ptr_vector<int>, wanted_>();
+ }
+ {
+ typedef as2::modifier_tag::iterate wanted_;
+ as2::put_aux::check_deduce<boost::array<int, 1>, wanted_>();
+ as2::put_aux::check_deduce<boost::ptr_array<int, 1>, wanted_>();
+ }
+ {
+ typedef as2::modifier_tag::push wanted_;
+ as2::put_aux::check_deduce<std::queue<int>, wanted_>();
+ as2::put_aux::check_deduce<std::stack<int>, wanted_>();
+ }
+ {
+ typedef as2::modifier_tag::insert wanted_;
+ as2::put_aux::check_deduce<std::set<int>, wanted_>();
+ typedef std::string str_;
+ as2::put_aux::check_deduce<std::map<str_, int>, wanted_>();
+ }
+ {
+ //[deduce_map
+ typedef std::map<std::string, int> cont_;
+ typedef as2::put_traits< cont_ > traits_;
+ BOOST_MPL_ASSERT((boost::is_same<
+ traits_::modifier_tag,
+ as2::modifier_tag::insert
+ >));
+ //]
+ }
+ }
+
+
+}// xxx_deduce
+}// xxx_put
+}// test_assign_v2

Added: sandbox/assign_v2/libs/assign/v2/test/put/deduce.h
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/libs/assign/v2/test/put/deduce.h 2011-01-27 18:25:24 EST (Thu, 27 Jan 2011)
@@ -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 LIBS_ASSIGN_V2_TEST_PUT_DEDUCE_ER_2010_H
+#define LIBS_ASSIGN_V2_TEST_PUT_DEDUCE_ER_2010_H
+
+namespace test_assign_v2{
+namespace xxx_put{
+namespace xxx_deduce{
+
+ void test();
+
+}// xxx_deduce
+}// xxx_put
+}// xxx_test_assign
+
+#endif

Added: sandbox/assign_v2/libs/assign/v2/test/put/ext.cpp
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/libs/assign/v2/test/put/ext.cpp 2011-01-27 18:25:24 EST (Thu, 27 Jan 2011)
@@ -0,0 +1,60 @@
+//////////////////////////////////////////////////////////////////////////////
+// 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 <vector>
+#include <map>
+#include <stack>
+#include <boost/lambda/lambda.hpp>
+#include <boost/array.hpp>
+#include <boost/assign/v2/detail/checking/check.hpp>
+#include <boost/assign/v2/put/ext.hpp>
+#include <boost/assign/v2/put/container.hpp>
+#include <libs/assign/v2/test/put/ext.h>
+
+namespace test_assign_v2{
+namespace xxx_put{
+namespace xxx_ext{
+
+ void test()
+ {
+ namespace as2 = boost::assign::v2;
+ namespace bl = boost::lambda;
+ {
+ //[iterate
+ boost::array<int, 3> cont;
+ ( as2::put( cont ) % as2::_iterate )( 1 )( 2 )( 3 );
+ BOOST_ASSIGN_V2_CHECK( cont[0] == 1 );
+ BOOST_ASSIGN_V2_CHECK( cont[2] == 3 );
+ //]
+ }
+ {
+ //[lookup
+ std::map<std::string, int> cont;
+ cont["jan"] = 31; cont["feb"] = 29; cont["mar"] = 32;
+ (
+ as2::put( cont ) % ( as2::_lookup = ( bl::_1 -= 1 ) )
+ )( "feb" )( "mar" );
+ BOOST_ASSIGN_V2_CHECK( cont["feb"] == 28 );
+ BOOST_ASSIGN_V2_CHECK( cont["mar"] == 31 );
+ //]
+ }
+ {
+ //[repeat
+ std::vector<int> cont;
+ ( as2::put( cont ) % ( as2::_repeat = 2 ) )( -1 )( 0 )( 1 );
+ BOOST_ASSIGN_V2_CHECK( cont.size() == 6 );
+ BOOST_ASSIGN_V2_CHECK( cont.front() == -1 );
+ BOOST_ASSIGN_V2_CHECK( cont.back() == 1 );
+ //]
+ }
+ }
+
+}// xxx_ext
+}// xxx_put
+}// test_assign_v2

Added: sandbox/assign_v2/libs/assign/v2/test/put/ext.h
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/libs/assign/v2/test/put/ext.h 2011-01-27 18:25:24 EST (Thu, 27 Jan 2011)
@@ -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 LIBS_ASSIGN_V2_TEST_PUT_EXT_ER_2010_H
+#define LIBS_ASSIGN_V2_TEST_PUT_EXT_ER_2010_H
+
+namespace test_assign_v2{
+namespace xxx_put{
+namespace xxx_ext{
+
+ void test();
+
+}// xxx_ext
+}// xxx_put
+}// xxx_test_assign
+
+#endif

Added: sandbox/assign_v2/libs/assign/v2/test/put/std.cpp
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/libs/assign/v2/test/put/std.cpp 2011-01-27 18:25:24 EST (Thu, 27 Jan 2011)
@@ -0,0 +1,40 @@
+//////////////////////////////////////////////////////////////////////////////
+// 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/assign/v2/detail/checking/check.hpp>
+#include <boost/assign/v2/put/std/push_front.hpp>
+#include <boost/assign/v2/put/container.hpp>
+#include <libs/assign/v2/test/put/std.h>
+
+namespace test_assign_v2{
+namespace xxx_put{
+namespace xxx_std{
+
+ void test()
+ {
+ namespace as2 = boost::assign::v2;
+
+ /* Only have to check those that are in /std which are not in
+ /deduce/dependee.hpp */
+
+ {
+ //[std_deque
+ typedef int T; T x = 0, y = 2, z = 1;
+ std::deque<T> seq;
+ ( as2::put( seq ) % as2::_push_front )( x )( y )( z );
+ BOOST_ASSIGN_V2_CHECK( seq[0] == z );
+ BOOST_ASSIGN_V2_CHECK( seq[2] == x );
+ //]
+ }
+ }
+
+}// xxx_std
+}// xxx_put
+}// test_assign_v2

Added: sandbox/assign_v2/libs/assign/v2/test/put/std.h
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/libs/assign/v2/test/put/std.h 2011-01-27 18:25:24 EST (Thu, 27 Jan 2011)
@@ -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 LIBS_ASSIGN_V2_TEST_PUT_STD_ER_2010_H
+#define LIBS_ASSIGN_V2_TEST_PUT_STD_ER_2010_H
+
+namespace test_assign_v2{
+namespace xxx_put{
+namespace xxx_std{
+
+ void test();
+
+}// xxx_std
+}// xxx_put
+}// xxx_test_assign
+
+#endif
\ No newline at end of file


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