Imported Upstream version 1.49.0
[platform/upstream/boost.git] / libs / assign / test / list_of_workaround.cpp
1 // Boost.Assign library
2 //
3 //  Copyright Thorsten Ottosen 2003-2004. Use, modification and
4 //  distribution is subject to the Boost Software License, Version
5 //  1.0. (See accompanying file LICENSE_1_0.txt or copy at
6 //  http://www.boost.org/LICENSE_1_0.txt)
7 //
8 // For more information, see http://www.boost.org/libs/assign/
9 //
10
11
12 #include <boost/detail/workaround.hpp>
13
14 #if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
15 #  pragma warn -8091 // supress warning in Boost.Test
16 #  pragma warn -8057 // unused argument argc/argv in Boost.Test
17 #endif
18
19 #include <boost/assign/list_of.hpp>
20 #include <boost/test/test_tools.hpp>
21 #include <vector>
22 #include <set>
23 #include <map>
24 #include <stack>
25 #include <queue>
26 #include <boost/array.hpp>
27
28 void check_list_of()
29 {
30     using namespace std;
31     using namespace boost;
32     using namespace boost::assign;
33     
34     vector<int>         v = list_of(1)(2)(3)(4).to_container( v );
35     set<int>            s = list_of(1)(2)(3)(4).to_container( s );  
36     map<int,int>        m = map_list_of(1,2)(2,3).to_container( m );
37     stack<int>         st = list_of(1)(2)(3)(4).to_adapter( st );
38     queue<int>         q  = list_of(1)(2)(3)(4).to_adapter( q ); 
39     array<int,4>       a  = list_of(1)(2)(3)(4).to_array( a );
40     const vector<int>  v2 = list_of(1).to_container( v2 );
41     const array<int,1> a2 = list_of(1).to_array( a2 );
42 }
43
44
45
46 #include <boost/test/unit_test.hpp>
47 using boost::unit_test::test_suite;
48
49 test_suite* init_unit_test_suite( int argc, char* argv[] )
50 {
51     test_suite* test = BOOST_TEST_SUITE( "List Test Suite" );
52
53     test->add( BOOST_TEST_CASE( &check_list_of ) );
54
55     return test;
56 }
57
58