Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r74645 - trunk/libs/test/example
From: gennadiy.rozental_at_[hidden]
Date: 2011-10-02 05:59:40


Author: rogeeff
Date: 2011-10-02 05:59:38 EDT (Sun, 02 Oct 2011)
New Revision: 74645
URL: http://svn.boost.org/trac/boost/changeset/74645

Log:
examples updated
Text files modified:
   trunk/libs/test/example/const_string_test.cpp | 2 --
   trunk/libs/test/example/est_example1.cpp | 4 ++--
   trunk/libs/test/example/est_example2.cpp | 4 ++--
   trunk/libs/test/example/exec_mon_example.cpp | 6 +++---
   trunk/libs/test/example/external_main_example_2.cpp | 2 +-
   trunk/libs/test/example/external_main_example_3.cpp | 2 +-
   trunk/libs/test/example/logged_exp_example.cpp | 4 ++--
   trunk/libs/test/example/unit_test_example_04.cpp | 20 +++++++++++++++++++-
   trunk/libs/test/example/unit_test_example_07.cpp | 1 -
   trunk/libs/test/example/unit_test_example_10.cpp | 2 +-
   trunk/libs/test/example/unit_test_example_12.cpp | 2 +-
   trunk/libs/test/example/unit_test_example_14.cpp | 4 ++--
   12 files changed, 34 insertions(+), 19 deletions(-)

Modified: trunk/libs/test/example/const_string_test.cpp
==============================================================================
--- trunk/libs/test/example/const_string_test.cpp (original)
+++ trunk/libs/test/example/const_string_test.cpp 2011-10-02 05:59:38 EDT (Sun, 02 Oct 2011)
@@ -68,8 +68,6 @@
     BOOST_CHECK_EQUAL( cs1[(size_t)2], cs1.at( 5 ) );
     BOOST_CHECK_EQUAL( cs1.at( cs1.length() - 1 ), 'g' );
 
- BOOST_CHECK_THROW( cs1.at( cs1.length() ), std::out_of_range );
-
     BOOST_CHECK_EQUAL( common_layer::first_char()( cs1 ), 't' );
     BOOST_CHECK_EQUAL( common_layer::last_char()( cs1 ) , 'g' );
 }

Modified: trunk/libs/test/example/est_example1.cpp
==============================================================================
--- trunk/libs/test/example/est_example1.cpp (original)
+++ trunk/libs/test/example/est_example1.cpp 2011-10-02 05:59:38 EDT (Sun, 02 Oct 2011)
@@ -8,8 +8,8 @@
 // Boost.Test
 #define BOOST_TEST_MAIN
 #include <boost/test/unit_test.hpp>
-#include <boost/test/exception_safety.hpp>
-#include <boost/test/mock_object.hpp>
+#include <boost/test/interaction/exception_safety.hpp>
+#include <boost/test/interaction/mock_object.hpp>
 using namespace boost::itest;
 
 // Boost

Modified: trunk/libs/test/example/est_example2.cpp
==============================================================================
--- trunk/libs/test/example/est_example2.cpp (original)
+++ trunk/libs/test/example/est_example2.cpp 2011-10-02 05:59:38 EDT (Sun, 02 Oct 2011)
@@ -8,8 +8,8 @@
 // Boost.Test
 #define BOOST_TEST_MAIN
 #include <boost/test/unit_test.hpp>
-#include <boost/test/exception_safety.hpp>
-#include <boost/test/mock_object.hpp>
+#include <boost/test/interaction/exception_safety.hpp>
+#include <boost/test/interaction/mock_object.hpp>
 using namespace boost::itest;
 
 // Boost

Modified: trunk/libs/test/example/exec_mon_example.cpp
==============================================================================
--- trunk/libs/test/example/exec_mon_example.cpp (original)
+++ trunk/libs/test/example/exec_mon_example.cpp 2011-10-02 05:59:38 EDT (Sun, 02 Oct 2011)
@@ -114,7 +114,7 @@
     ex_mon.register_exception_translator<my_exception2>( &translate_my_exception2, "except2" );
 
     try {
- ex_mon.execute( ::boost::unit_test::callback0<int>( dangerous_call( argc ) ) );
+ ex_mon.execute( dangerous_call( argc ) );
         std::cout << "Should reach this line " << __LINE__ << std::endl;
     }
     catch ( boost::execution_exception const& ex ) {
@@ -126,7 +126,7 @@
     ex_mon.erase_exception_translator( "except2" );
 
     try {
- ex_mon.execute( ::boost::unit_test::callback0<int>( dangerous_call( 5 ) ) );
+ ex_mon.execute( dangerous_call( 5 ) );
         std::cout << "Should not reach this line " << __LINE__ << std::endl;
     }
     catch ( boost::execution_exception const& ex ) {
@@ -138,7 +138,7 @@
     ex_mon.erase_exception_translator<my_exception1>();
 
     try {
- ex_mon.execute( ::boost::unit_test::callback0<int>( dangerous_call( 1 ) ) );
+ ex_mon.execute( dangerous_call( 1 ) );
         std::cout << "Should not reach this line " << __LINE__ << std::endl;
     }
     catch ( boost::execution_exception const& ex ) {

Modified: trunk/libs/test/example/external_main_example_2.cpp
==============================================================================
--- trunk/libs/test/example/external_main_example_2.cpp (original)
+++ trunk/libs/test/example/external_main_example_2.cpp 2011-10-02 05:59:38 EDT (Sun, 02 Oct 2011)
@@ -10,7 +10,7 @@
 
 BOOST_AUTO_TEST_CASE( test_case_1 )
 {
- BOOST_MESSAGE( "Testing is in progress" );
+ BOOST_TEST_MESSAGE( "Testing is in progress" );
 
      BOOST_CHECK( false );
 }

Modified: trunk/libs/test/example/external_main_example_3.cpp
==============================================================================
--- trunk/libs/test/example/external_main_example_3.cpp (original)
+++ trunk/libs/test/example/external_main_example_3.cpp 2011-10-02 05:59:38 EDT (Sun, 02 Oct 2011)
@@ -9,7 +9,7 @@
 
 BOOST_AUTO_TEST_CASE( test_case_1 )
 {
- BOOST_MESSAGE( "Testing is in progress" );
+ BOOST_TEST_MESSAGE( "Testing is in progress" );
 
      BOOST_CHECK( false );
 }

Modified: trunk/libs/test/example/logged_exp_example.cpp
==============================================================================
--- trunk/libs/test/example/logged_exp_example.cpp (original)
+++ trunk/libs/test/example/logged_exp_example.cpp 2011-10-02 05:59:38 EDT (Sun, 02 Oct 2011)
@@ -8,8 +8,8 @@
 // Boost.Test
 #define BOOST_TEST_MAIN
 #include <boost/test/unit_test.hpp>
-#include <boost/test/logged_expectations.hpp>
-#include <boost/test/mock_object.hpp>
+#include <boost/test/interaction/logged_expectations.hpp>
+#include <boost/test/interaction/mock_object.hpp>
 using namespace boost::itest;
 
 // Boost

Modified: trunk/libs/test/example/unit_test_example_04.cpp
==============================================================================
--- trunk/libs/test/example/unit_test_example_04.cpp (original)
+++ trunk/libs/test/example/unit_test_example_04.cpp 2011-10-02 05:59:38 EDT (Sun, 02 Oct 2011)
@@ -8,12 +8,20 @@
 // Boost.Test
 #define BOOST_TEST_MODULE Unit_test_example_04
 #include <boost/test/unit_test.hpp>
+namespace unittest=boost::unit_test;
 
 //____________________________________________________________________________//
 
 // automatically registered test cases could be organized in test suites
 BOOST_AUTO_TEST_SUITE( my_suite1 )
 
+BOOST_AUTO_TEST_CASE_EXPECTED_FAILURES(my_test1,1);
+
+BOOST_TEST_DECORATOR(
++ unittest::label( "L1" )
++ unittest::label( "L2" )
++ unittest::description( "test suite description" )
+)
 BOOST_AUTO_TEST_CASE( my_test1 )
 {
     BOOST_CHECK( 2 == 1 );
@@ -45,9 +53,16 @@
 
 //____________________________________________________________________________//
 
+BOOST_TEST_DECORATOR(
+**** unittest::label( "L3" )
+**** unittest::description( "suite description" )
+)
 BOOST_AUTO_TEST_SUITE( my_suite2 )
 
 // this test case belongs to suite2 test suite
+BOOST_TEST_DECORATOR(
++ unittest::depends_on( "my_suite2/internal_suite/my_test5" )
+)
 BOOST_AUTO_TEST_CASE( my_test4 )
 {
     int i = 0;
@@ -59,6 +74,10 @@
 
 // this test case belongs to my_suite2:internal_suite test suite
 
+BOOST_TEST_DECORATOR(
+- unittest::timeout( 100 )
+- unittest::expected_failures( 1 )
+)
 BOOST_AUTO_TEST_CASE( my_test5 )
 {
     int i = 0;
@@ -68,7 +87,6 @@
 
 BOOST_AUTO_TEST_SUITE_END()
 
-
 BOOST_AUTO_TEST_SUITE_END()
 
 //____________________________________________________________________________//

Modified: trunk/libs/test/example/unit_test_example_07.cpp
==============================================================================
--- trunk/libs/test/example/unit_test_example_07.cpp (original)
+++ trunk/libs/test/example/unit_test_example_07.cpp 2011-10-02 05:59:38 EDT (Sun, 02 Oct 2011)
@@ -8,7 +8,6 @@
 // Boost.Test
 #define BOOST_TEST_MODULE Unit_test_example_07
 #include <boost/test/unit_test.hpp>
-#include <boost/test/test_case_template.hpp>
 #include <boost/mpl/list.hpp>
 
 //____________________________________________________________________________//

Modified: trunk/libs/test/example/unit_test_example_10.cpp
==============================================================================
--- trunk/libs/test/example/unit_test_example_10.cpp (original)
+++ trunk/libs/test/example/unit_test_example_10.cpp 2011-10-02 05:59:38 EDT (Sun, 02 Oct 2011)
@@ -7,7 +7,7 @@
 // See http://www.boost.org/libs/test for the library home page.
 
 // Boost.Test
-#include <boost/test/floating_point_comparison.hpp>
+#include <boost/test/tools/floating_point_comparison.hpp>
 #include <boost/test/unit_test.hpp>
 using namespace boost::unit_test;
 using boost::math::fpc::close_at_tolerance;

Modified: trunk/libs/test/example/unit_test_example_12.cpp
==============================================================================
--- trunk/libs/test/example/unit_test_example_12.cpp (original)
+++ trunk/libs/test/example/unit_test_example_12.cpp 2011-10-02 05:59:38 EDT (Sun, 02 Oct 2011)
@@ -7,7 +7,7 @@
 
 // Boost.Test
 #include <boost/test/unit_test.hpp>
-#include <boost/test/floating_point_comparison.hpp>
+#include <boost/test/tools/floating_point_comparison.hpp>
 #include <boost/test/parameterized_test.hpp>
 using namespace boost::unit_test;
 

Modified: trunk/libs/test/example/unit_test_example_14.cpp
==============================================================================
--- trunk/libs/test/example/unit_test_example_14.cpp (original)
+++ trunk/libs/test/example/unit_test_example_14.cpp 2011-10-02 05:59:38 EDT (Sun, 02 Oct 2011)
@@ -1,8 +1,8 @@
 #define BOOST_TEST_TOOL_REPORT_WARN_FAILURE( assertion_descr ) \
     std::cout << "Condition " << assertion_descr << " is not satisfied\n"
 
-#include <boost/test/prod_tools.hpp>
-#include <boost/exception.hpp>
+#include <boost/test/tools/prod_tools.hpp>
+#include <boost/exception/all.hpp>
 #include <boost/noncopyable.hpp>
 
 #include <iostream>


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