basic.cpp 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. #include <boost/detail/workaround.hpp>
  11. #if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
  12. # pragma warn -8091 // suppress warning in Boost.Test
  13. # pragma warn -8057 // unused argument argc/argv in Boost.Test
  14. #endif
  15. #include <boost/assign/std/vector.hpp>
  16. #include <boost/assign/std/map.hpp>
  17. #include <string>
  18. using namespace boost::assign;
  19. void check_basic_usage()
  20. {
  21. std::vector<int> v;
  22. v += 1,2,3,4,5,6,7,8,9;
  23. push_back( v )(10)(11);
  24. std::map<std::string,int> m;
  25. insert( m )( "foo", 1 )( "bar", 2 );
  26. }
  27. #include <boost/test/unit_test.hpp>
  28. using boost::unit_test::test_suite;
  29. test_suite* init_unit_test_suite( int argc, char* argv[] )
  30. {
  31. test_suite* test = BOOST_TEST_SUITE( "Assign Test Suite" );
  32. test->add( BOOST_TEST_CASE( &check_basic_usage ) );
  33. return test;
  34. }