Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r74643 - in trunk/libs/test/test: . test_files
From: gennadiy.rozental_at_[hidden]
Date: 2011-10-02 05:57:36


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

Log:
updated unit tests
Text files modified:
   trunk/libs/test/test/basic_cstring_test.cpp | 3 +--
   trunk/libs/test/test/class_properties_test.cpp | 8 ++++++++
   trunk/libs/test/test/errors_handling_test.cpp | 2 +-
   trunk/libs/test/test/output_test_stream_test.cpp | 2 +-
   trunk/libs/test/test/result_report_test.cpp | 2 +-
   trunk/libs/test/test/run_by_name_label_test.cpp | 1 +
   trunk/libs/test/test/test_case_template_test.cpp | 1 -
   trunk/libs/test/test/test_files/test_tools_test.pattern | 32 ++++++++++++++++++++++++++++++++
   trunk/libs/test/test/test_fp_comparisons.cpp | 2 --
   trunk/libs/test/test/test_tools_test.cpp | 38 +++++++++++++++++++++++++++++++++++++-
   trunk/libs/test/test/test_tree_management_test.cpp | 14 +++++++-------
   11 files changed, 89 insertions(+), 16 deletions(-)

Modified: trunk/libs/test/test/basic_cstring_test.cpp
==============================================================================
--- trunk/libs/test/test/basic_cstring_test.cpp (original)
+++ trunk/libs/test/test/basic_cstring_test.cpp 2011-10-02 05:57:34 EDT (Sun, 02 Oct 2011)
@@ -19,12 +19,11 @@
 
 // Boost.Test
 #include <boost/test/unit_test.hpp>
-#include <boost/test/test_case_template.hpp>
 
 #include <boost/test/utils/basic_cstring/basic_cstring.hpp>
 #include <boost/test/utils/basic_cstring/compare.hpp>
 #include <boost/test/utils/basic_cstring/io.hpp>
-#include <boost/test/output_test_stream.hpp>
+#include <boost/test/tools/output_test_stream.hpp>
 namespace utf = boost::unit_test;
 namespace tt = boost::test_tools;
 using utf::const_string;

Modified: trunk/libs/test/test/class_properties_test.cpp
==============================================================================
--- trunk/libs/test/test/class_properties_test.cpp (original)
+++ trunk/libs/test/test/class_properties_test.cpp 2011-10-02 05:57:34 EDT (Sun, 02 Oct 2011)
@@ -137,6 +137,7 @@
     BOOST_CHECK_EQUAL( p_two / 2, 1 );
 
     BOOST_CHECK( !p_b_ptr );
+
     C::init();
     BOOST_CHECK( p_b_ptr );
 
@@ -145,6 +146,12 @@
     BOOST_CHECK( p_a_ptr );
     E::reset();
     BOOST_CHECK( p_a_ptr );
+
+ if( p_a_ptr )
+ delete p_a_ptr.get();
+
+ if( p_b_ptr )
+ delete p_b_ptr.get();
 }
 
 //____________________________________________________________________________//
@@ -180,4 +187,5 @@
 
 //____________________________________________________________________________//
 
+
 // EOF

Modified: trunk/libs/test/test/errors_handling_test.cpp
==============================================================================
--- trunk/libs/test/test/errors_handling_test.cpp (original)
+++ trunk/libs/test/test/errors_handling_test.cpp 2011-10-02 05:57:34 EDT (Sun, 02 Oct 2011)
@@ -18,7 +18,7 @@
 // Boost.Test
 #define BOOST_TEST_MAIN
 #include <boost/test/unit_test.hpp>
-#include <boost/test/output_test_stream.hpp>
+#include <boost/test/tools/output_test_stream.hpp>
 #include <boost/test/unit_test_log.hpp>
 #include <boost/test/unit_test_suite.hpp>
 #include <boost/test/framework.hpp>

Modified: trunk/libs/test/test/output_test_stream_test.cpp
==============================================================================
--- trunk/libs/test/test/output_test_stream_test.cpp (original)
+++ trunk/libs/test/test/output_test_stream_test.cpp 2011-10-02 05:57:34 EDT (Sun, 02 Oct 2011)
@@ -15,7 +15,7 @@
 // Boost.Test
 #define BOOST_TEST_MAIN
 #include <boost/test/unit_test.hpp>
-#include <boost/test/output_test_stream.hpp>
+#include <boost/test/tools/output_test_stream.hpp>
 using boost::test_tools::output_test_stream;
 
 // STL

Modified: trunk/libs/test/test/result_report_test.cpp
==============================================================================
--- trunk/libs/test/test/result_report_test.cpp (original)
+++ trunk/libs/test/test/result_report_test.cpp 2011-10-02 05:57:34 EDT (Sun, 02 Oct 2011)
@@ -17,7 +17,7 @@
 #define BOOST_TEST_MAIN
 #include <boost/test/unit_test.hpp>
 #include <boost/test/results_reporter.hpp>
-#include <boost/test/output_test_stream.hpp>
+#include <boost/test/tools/output_test_stream.hpp>
 #include <boost/test/unit_test_log.hpp>
 #include <boost/test/unit_test_suite.hpp>
 #include <boost/test/framework.hpp>

Modified: trunk/libs/test/test/run_by_name_label_test.cpp
==============================================================================
--- trunk/libs/test/test/run_by_name_label_test.cpp (original)
+++ trunk/libs/test/test/run_by_name_label_test.cpp 2011-10-02 05:57:34 EDT (Sun, 02 Oct 2011)
@@ -531,3 +531,4 @@
 //____________________________________________________________________________//
 
 // EOF
+

Modified: trunk/libs/test/test/test_case_template_test.cpp
==============================================================================
--- trunk/libs/test/test/test_case_template_test.cpp (original)
+++ trunk/libs/test/test/test_case_template_test.cpp 2011-10-02 05:57:34 EDT (Sun, 02 Oct 2011)
@@ -15,7 +15,6 @@
 // Boost.Test
 #define BOOST_TEST_MAIN
 #include <boost/test/unit_test.hpp>
-#include <boost/test/test_case_template.hpp>
 #include <boost/test/unit_test_log.hpp>
 #include <boost/test/results_collector.hpp>
 

Modified: trunk/libs/test/test/test_files/test_tools_test.pattern
==============================================================================
--- trunk/libs/test/test/test_files/test_tools_test.pattern (original)
+++ trunk/libs/test/test/test_files/test_tools_test.pattern 2011-10-02 05:57:34 EDT (Sun, 02 Oct 2011)
@@ -69,3 +69,35 @@
 535: last checkpoint: Going to do a silly things
 0: fatal error in "test_BOOST_TEST_PASSPOINT": unknown type
 546: last checkpoint
+603: error in "test_context_logging": check false failed
+Failure occurred in a following context:
+ some context
+607: error in "test_context_logging": check false failed
+Failure occurred in a following context:
+ some more context: 12
+612: error in "test_context_logging": check false failed
+Failure occurred in a following context:
+ info 1
+ info 2
+ info 3
+615: error in "test_context_logging": check false failed
+Failure occurred in a following context:
+ some sticky context
+618: error in "test_context_logging": check false failed
+Failure occurred in a following context:
+ some sticky context
+ more context
+621: error in "test_context_logging": check false failed
+Failure occurred in a following context:
+ some sticky context
+ different subcontext
+625: error in "test_context_logging": check false failed
+Failure occurred in a following context:
+ outer context
+628: error in "test_context_logging": check false failed
+Failure occurred in a following context:
+ outer context
+ inner context
+631: error in "test_context_logging": check false failed
+Failure occurred in a following context:
+ outer context

Modified: trunk/libs/test/test/test_fp_comparisons.cpp
==============================================================================
--- trunk/libs/test/test/test_fp_comparisons.cpp (original)
+++ trunk/libs/test/test/test_fp_comparisons.cpp 2011-10-02 05:57:34 EDT (Sun, 02 Oct 2011)
@@ -15,8 +15,6 @@
 // Boost.Test
 #define BOOST_TEST_MAIN
 #include <boost/test/unit_test.hpp>
-#include <boost/test/test_case_template.hpp>
-#include <boost/test/floating_point_comparison.hpp>
 
 // Boost
 #include <boost/mpl/list.hpp>

Modified: trunk/libs/test/test/test_tools_test.cpp
==============================================================================
--- trunk/libs/test/test/test_tools_test.cpp (original)
+++ trunk/libs/test/test/test_tools_test.cpp 2011-10-02 05:57:34 EDT (Sun, 02 Oct 2011)
@@ -16,7 +16,7 @@
 #define BOOST_TEST_MAIN
 #include <boost/test/unit_test.hpp>
 #include <boost/test/unit_test_log.hpp>
-#include <boost/test/output_test_stream.hpp>
+#include <boost/test/tools/output_test_stream.hpp>
 #include <boost/test/execution_monitor.hpp>
 #include <boost/test/detail/unit_test_parameters.hpp>
 #include <boost/test/output/compiler_log_formatter.hpp>
@@ -597,6 +597,42 @@
 
 //____________________________________________________________________________//
 
+TEST_CASE( test_context_logging )
+{
+ BOOST_TEST_INFO( "some context" );
+ BOOST_CHECK( false );
+
+ int i = 12;
+ BOOST_TEST_INFO( "some more context: " << i );
+ BOOST_CHECK( false );
+
+ BOOST_TEST_INFO( "info 1" );
+ BOOST_TEST_INFO( "info 2" );
+ BOOST_TEST_INFO( "info 3" );
+ BOOST_CHECK( false );
+
+ BOOST_TEST_CONTEXT( "some sticky context" ) {
+ BOOST_CHECK( false );
+
+ BOOST_TEST_INFO( "more context" );
+ BOOST_CHECK( false );
+
+ BOOST_TEST_INFO( "different subcontext" );
+ BOOST_CHECK( false );
+ }
+
+ BOOST_TEST_CONTEXT( "outer context" ) {
+ BOOST_CHECK( false );
+
+ BOOST_TEST_CONTEXT( "inner context" ) {
+ BOOST_CHECK( false );
+ }
+
+ BOOST_CHECK( false );
+ }
+}
+
+//____________________________________________________________________________//
 
 // !! CHECK_SMALL
 

Modified: trunk/libs/test/test/test_tree_management_test.cpp
==============================================================================
--- trunk/libs/test/test/test_tree_management_test.cpp (original)
+++ trunk/libs/test/test/test_tree_management_test.cpp 2011-10-02 05:57:34 EDT (Sun, 02 Oct 2011)
@@ -100,7 +100,7 @@
     BOOST_CHECK_EQUAL( tc1->p_expected_failures, 0U );
     BOOST_CHECK_EQUAL( tc1->p_timeout, 0U );
     BOOST_CHECK_EQUAL( tc1->p_name, const_string( "empty" ) );
- BOOST_CHECK( tc1->test_func() );
+ BOOST_CHECK( tc1->p_test_func );
     BOOST_CHECK( tc1->p_enabled );
 
     BOOST_CHECK_EQUAL( &framework::get<test_case>( tc1->p_id ), tc1 );
@@ -256,9 +256,9 @@
     BOOST_CHECK_EQUAL( tc2->p_name, const_string( "A::test_methodA2" ) );
 
     BOOST_CHECK_EQUAL( instA->i, 0 );
- tc1->test_func()();
+ tc1->p_test_func.get()();
     BOOST_CHECK_EQUAL( instA->i, 1 );
- tc2->test_func()();
+ tc2->p_test_func.get()();
     BOOST_CHECK_EQUAL( instA->i, 2 );
 
     boost::shared_ptr<B> instB( new B );
@@ -269,9 +269,9 @@
     BOOST_CHECK_EQUAL( tc4->p_name, const_string( "B::test_methodB" ) );
 
     BOOST_CHECK_EQUAL( instB->i, 0 );
- tc3->test_func()();
+ tc3->p_test_func.get()();
     BOOST_CHECK_EQUAL( instB->i, 1 );
- tc4->test_func()();
+ tc4->p_test_func.get()();
     BOOST_CHECK_EQUAL( instB->i, 0 );
 
     boost::shared_ptr<C> instC1( new D );
@@ -279,7 +279,7 @@
 
     BOOST_CHECK_EQUAL( tc5->p_name, const_string( "C::test_method" ) );
 
- tc5->test_func()();
+ tc5->p_test_func.get()();
     BOOST_CHECK_EQUAL( instC1->i, 1 );
 
     boost::shared_ptr<C> instC2( new E );
@@ -287,7 +287,7 @@
 
     BOOST_CHECK_EQUAL( tc6->p_name, const_string( "C::test_method" ) );
 
- tc6->test_func()();
+ tc6->p_test_func.get()();
     BOOST_CHECK_EQUAL( instC2->i, 2 );
 }
 


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