Boost logo

Boost-Commit :

From: gennadiy.rozental_at_[hidden]
Date: 2008-07-24 23:55:04


Author: rogeeff
Date: 2008-07-24 23:55:03 EDT (Thu, 24 Jul 2008)
New Revision: 47790
URL: http://svn.boost.org/trac/boost/changeset/47790

Log:
date
Text files modified:
   trunk/libs/test/test/test_files/test_tools_test.pattern | 81 ++++++++++++++++++++-------------------
   trunk/libs/test/test/test_fp_comparisons.cpp | 2
   trunk/libs/test/test/test_tools_test.cpp | 9 +++
   trunk/libs/test/test/test_tree_management_test.cpp | 77 +++++++++++++++++++++++++++++++++++++
   trunk/libs/test/test/token_iterator_test.cpp | 2
   trunk/libs/test/tools/console_test_runner/src/console_test_runner.cpp | 2
   trunk/libs/test/tools/console_test_runner/test/test_runner_test.cpp | 2
   7 files changed, 128 insertions(+), 47 deletions(-)

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 2008-07-24 23:55:03 EDT (Thu, 24 Jul 2008)
@@ -13,50 +13,51 @@
 208: error in "test_BOOST_CHECK_MESSAGE": Well, may be that what I believe in
 210: error in "test_BOOST_CHECK_MESSAGE": Checking predicate failed. Some explanation
 213: info: check 'Could it fail?' passed
-220: fatal error in "test_BOOST_REQUIRE_MESSAGE": Here we should stop
-223: info: check 'That's OK' passed
-223: error in "test_BOOST_REQUIRE_MESSAGE": not aborted
-230: error in "test_BOOST_ERROR": Fail to miss an error
-237: fatal error in "test_BOOST_FAIL": No! No! Show must go on.
-253: error in "test_BOOST_CHECK_THROW": exception my_exception is expected
-256: warning in "test_BOOST_CHECK_THROW": exception my_exception is expected
-259: fatal error in "test_BOOST_CHECK_THROW": exception my_exception is expected
-262: info: check 'exception my_exception is caught' passed
-269: error in "test_BOOST_CHECK_EXCEPTION": incorrect exception my_exception is caught
-272: info: check 'incorrect exception my_exception is caught' passed
-282: error in "test_BOOST_CHECK_NO_THROW": exception thrown by throw my_exception()
-328: error in "test_BOOST_CHECK_EQUAL": check i == j failed [1 != 2]
-334: error in "test_BOOST_CHECK_EQUAL": check str1 == str2 failed [test1 != test12]
-337: error in "test_BOOST_CHECK_EQUAL": check i+1 == j failed [4 != 2]
-340: info: check str1 == str3+1 passed
-349: fatal error in "test_BOOST_CHECK_EQUAL": critical check str1 == str2 failed [test != null string]
-355: warning in "test_BOOST_CHECK_EQUAL": condition b1 == b2 is not satisfied [B(1) != B(2)]
-361: error in "test_BOOST_CHECK_EQUAL": check c1 == c3 failed [C(0,100) != C(1,102)]. Index mismatch
-362: error in "test_BOOST_CHECK_EQUAL": check c1 == c2 failed [C(0,100) != C(0,101)]. Id mismatch
-366: error in "test_BOOST_CHECK_EQUAL": check ch1 == ch2 failed [0xfffffffe != 0xfffffffd]
-377: error in "test_BOOST_CHECK_LOGICAL_EXPR": check ++i != j failed [2 == 2]
-379: error in "test_BOOST_CHECK_LOGICAL_EXPR": check i < j failed [2 >= 2]
-380: error in "test_BOOST_CHECK_LOGICAL_EXPR": check i > j failed [2 <= 2]
-387: error in "test_BOOST_CHECK_LOGICAL_EXPR": check i <= j failed [3 > 2]
-388: error in "test_BOOST_CHECK_LOGICAL_EXPR": check j >= i failed [2 < 3]
-393: error in "test_BOOST_CHECK_LOGICAL_EXPR": check str1 != str2 failed [test1 == test1]
-423: error in "test_BOOST_CHECK_PREDICATE": check is_even( i ) failed for ( 17 )
-426: error in "test_BOOST_CHECK_PREDICATE": check not_equal_to<int>()( i, 17 ) failed for ( 17, 17 )
-432: warning in "test_BOOST_CHECK_PREDICATE": condition moo( 12, i, j ) is not satisfied for ( 12, 17, 15 )
-440: error in "test_BOOST_CHECK_PREDICATE": check compare_lists( l1, l2 ) failed for ( , ). Different sizes [2!=0]
-451: error in "test_BOOST_REQUIRE_PREDICATE": not aborted
-453: fatal error in "test_BOOST_REQUIRE_PREDICATE": critical check less_equal<int>()( arg2, arg1 ) failed for ( 2, 1 )
-474: error in "test_BOOST_CHECK_EQUAL_COLLECTIONS": check { testlist.begin(), testlist.end() } == { pattern, pattern+7 } failed.
+218: error in "test_BOOST_CHECK_MESSAGE": Comparing 1 and 2: some explanation
+225: fatal error in "test_BOOST_REQUIRE_MESSAGE": Here we should stop
+228: info: check 'That's OK' passed
+228: error in "test_BOOST_REQUIRE_MESSAGE": not aborted
+235: error in "test_BOOST_ERROR": Fail to miss an error
+242: fatal error in "test_BOOST_FAIL": No! No! Show must go on.
+258: error in "test_BOOST_CHECK_THROW": exception my_exception is expected
+261: warning in "test_BOOST_CHECK_THROW": exception my_exception is expected
+264: fatal error in "test_BOOST_CHECK_THROW": exception my_exception is expected
+267: info: check 'exception my_exception is caught' passed
+274: error in "test_BOOST_CHECK_EXCEPTION": incorrect exception my_exception is caught
+277: info: check 'incorrect exception my_exception is caught' passed
+287: error in "test_BOOST_CHECK_NO_THROW": exception thrown by throw my_exception()
+333: error in "test_BOOST_CHECK_EQUAL": check i == j failed [1 != 2]
+339: error in "test_BOOST_CHECK_EQUAL": check str1 == str2 failed [test1 != test12]
+342: error in "test_BOOST_CHECK_EQUAL": check i+1 == j failed [4 != 2]
+345: info: check str1 == str3+1 passed
+354: fatal error in "test_BOOST_CHECK_EQUAL": critical check str1 == str2 failed [test != null string]
+360: warning in "test_BOOST_CHECK_EQUAL": condition b1 == b2 is not satisfied [B(1) != B(2)]
+366: error in "test_BOOST_CHECK_EQUAL": check c1 == c3 failed [C(0,100) != C(1,102)]. Index mismatch
+367: error in "test_BOOST_CHECK_EQUAL": check c1 == c2 failed [C(0,100) != C(0,101)]. Id mismatch
+371: error in "test_BOOST_CHECK_EQUAL": check ch1 == ch2 failed [0xfffffffe != 0xfffffffd]
+382: error in "test_BOOST_CHECK_LOGICAL_EXPR": check ++i != j failed [2 == 2]
+384: error in "test_BOOST_CHECK_LOGICAL_EXPR": check i < j failed [2 >= 2]
+385: error in "test_BOOST_CHECK_LOGICAL_EXPR": check i > j failed [2 <= 2]
+392: error in "test_BOOST_CHECK_LOGICAL_EXPR": check i <= j failed [3 > 2]
+393: error in "test_BOOST_CHECK_LOGICAL_EXPR": check j >= i failed [2 < 3]
+398: error in "test_BOOST_CHECK_LOGICAL_EXPR": check str1 != str2 failed [test1 == test1]
+428: error in "test_BOOST_CHECK_PREDICATE": check is_even( i ) failed for ( 17 )
+431: error in "test_BOOST_CHECK_PREDICATE": check not_equal_to<int>()( i, 17 ) failed for ( 17, 17 )
+437: warning in "test_BOOST_CHECK_PREDICATE": condition moo( 12, i, j ) is not satisfied for ( 12, 17, 15 )
+445: error in "test_BOOST_CHECK_PREDICATE": check compare_lists( l1, l2 ) failed for ( , ). Different sizes [2!=0]
+456: error in "test_BOOST_REQUIRE_PREDICATE": not aborted
+458: fatal error in "test_BOOST_REQUIRE_PREDICATE": critical check less_equal<int>()( arg2, arg1 ) failed for ( 2, 1 )
+479: error in "test_BOOST_CHECK_EQUAL_COLLECTIONS": check { testlist.begin(), testlist.end() } == { pattern, pattern+7 } failed.
 Mismatch in a position 2: 4 != 3
 Mismatch in a position 5: 7 != 6
-475: error in "test_BOOST_CHECK_EQUAL_COLLECTIONS": check { testlist.begin(), testlist.end() } == { pattern, pattern+2 } failed.
+480: error in "test_BOOST_CHECK_EQUAL_COLLECTIONS": check { testlist.begin(), testlist.end() } == { pattern, pattern+2 } failed.
 Collections size mismatch: 7 != 2
-484: error in "test_BOOST_CHECK_BITWISE_EQUAL": check (char)0x06 =.= (char)0x16 failed.
+489: error in "test_BOOST_CHECK_BITWISE_EQUAL": check (char)0x06 =.= (char)0x16 failed.
 Mismatch in a position 4
-487: warning in "test_BOOST_CHECK_BITWISE_EQUAL": condition (char)0x26 =.= (char)0x04 is not satisfied.
+492: warning in "test_BOOST_CHECK_BITWISE_EQUAL": condition (char)0x26 =.= (char)0x04 is not satisfied.
 Mismatch in a position 1
 Mismatch in a position 5
-490: fatal error in "test_BOOST_CHECK_BITWISE_EQUAL": critical check (char)0x26 =.= (int)0x26 failed.
+495: fatal error in "test_BOOST_CHECK_BITWISE_EQUAL": critical check (char)0x26 =.= (int)0x26 failed.
 Operands bit sizes mismatch: 8 != 32
 still testing
 1+1=2
@@ -65,6 +66,6 @@
 0x14
   20
 0: fatal error in "test_BOOST_TEST_CHECKPOINT": C string: some error
-525: last checkpoint: Going to do a silly things
+530: last checkpoint: Going to do a silly things
 0: fatal error in "test_BOOST_TEST_PASSPOINT": unknown type
-536: last checkpoint
+541: last checkpoint

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 2008-07-24 23:55:03 EDT (Thu, 24 Jul 2008)
@@ -1,4 +1,4 @@
-// (C) Copyright Gennadiy Rozental 2001-2007.
+// (C) Copyright Gennadiy Rozental 2001-2008.
 // Distributed under 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)

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 2008-07-24 23:55:03 EDT (Thu, 24 Jul 2008)
@@ -1,4 +1,4 @@
-// (C) Copyright Gennadiy Rozental 2001-2007.
+// (C) Copyright Gennadiy Rozental 2001-2008.
 // Distributed under 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)
@@ -211,6 +211,11 @@
 
     unit_test_log.set_threshold_level( log_successful_tests );
     BOOST_CHECK_MESSAGE( 2+2 == 4, "Could it fail?" );
+
+ int i = 1;
+ int j = 2;
+ std::string msg = "some explanation";
+ BOOST_CHECK_MESSAGE( i > j, "Comparing " << i << " and " << j << ": " << msg );
 }
 
 //____________________________________________________________________________//
@@ -509,7 +514,7 @@
     A a = A();
     BOOST_TEST_MESSAGE( a );
 
-#if !defined(BOOST_NO_STD_LOCALE) && ( !defined(BOOST_MSVC) || BOOST_WORKAROUND(BOOST_MSVC, >= 1310))
+#if BOOST_TEST_USE_STD_LOCALE
     BOOST_TEST_MESSAGE( std::hex << std::showbase << 20 );
 #else
     BOOST_TEST_MESSAGE( "0x14" );

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 2008-07-24 23:55:03 EDT (Thu, 24 Jul 2008)
@@ -152,7 +152,7 @@
 {
     test_suite& mts = framework::master_test_suite();
 
- BOOST_CHECK_EQUAL( mts.size(), 7U );
+ BOOST_CHECK_EQUAL( mts.size(), 8U );
     BOOST_CHECK_EQUAL( mts.p_expected_failures, 2U );
 
     BOOST_CHECK_EQUAL( framework::get<test_case>( mts.get( "automated_test_units_registration" ) ).p_expected_failures, 0U );
@@ -180,4 +180,79 @@
 
 //____________________________________________________________________________//
 
+struct A {
+ A() : i(0){}
+ void test_methodA1() { i++; }
+ void test_methodA2() { i++; }
+
+ int i;
+};
+
+struct B : public A {
+ void test_methodB() { i--; }
+};
+
+struct C {
+ C() : i( 0 ) {}
+
+ void virtual test_method() = 0;
+
+ int i;
+};
+
+struct D : public C {
+ void virtual test_method() { i++; }
+};
+
+struct E : public C {
+ void virtual test_method() { i+=2; }
+};
+
+BOOST_AUTO_TEST_CASE( user_class_test_case )
+{
+ boost::shared_ptr<A> instA( new A );
+ test_case* tc1 = BOOST_CLASS_TEST_CASE( &A::test_methodA1, instA );
+ test_case* tc2 = BOOST_CLASS_TEST_CASE( &A::test_methodA2, instA );
+
+ BOOST_CHECK_EQUAL( tc1->p_name, const_string( "A::test_methodA1" ) );
+ BOOST_CHECK_EQUAL( tc2->p_name, const_string( "A::test_methodA2" ) );
+
+ BOOST_CHECK_EQUAL( instA->i, 0 );
+ tc1->test_func()();
+ BOOST_CHECK_EQUAL( instA->i, 1 );
+ tc2->test_func()();
+ BOOST_CHECK_EQUAL( instA->i, 2 );
+
+ boost::shared_ptr<B> instB( new B );
+ test_case* tc3 = BOOST_CLASS_TEST_CASE( &A::test_methodA1, instB );
+ test_case* tc4 = BOOST_CLASS_TEST_CASE( &B::test_methodB, instB );
+
+ BOOST_CHECK_EQUAL( tc3->p_name, const_string( "A::test_methodA1" ) );
+ BOOST_CHECK_EQUAL( tc4->p_name, const_string( "B::test_methodB" ) );
+
+ BOOST_CHECK_EQUAL( instB->i, 0 );
+ tc3->test_func()();
+ BOOST_CHECK_EQUAL( instB->i, 1 );
+ tc4->test_func()();
+ BOOST_CHECK_EQUAL( instB->i, 0 );
+
+ boost::shared_ptr<C> instC1( new D );
+ test_case* tc5 = BOOST_CLASS_TEST_CASE( &C::test_method, instC1 );
+
+ BOOST_CHECK_EQUAL( tc5->p_name, const_string( "C::test_method" ) );
+
+ tc5->test_func()();
+ BOOST_CHECK_EQUAL( instC1->i, 1 );
+
+ boost::shared_ptr<C> instC2( new E );
+ test_case* tc6 = BOOST_CLASS_TEST_CASE( &C::test_method, instC2 );
+
+ BOOST_CHECK_EQUAL( tc6->p_name, const_string( "C::test_method" ) );
+
+ tc6->test_func()();
+ BOOST_CHECK_EQUAL( instC2->i, 2 );
+}
+
+//____________________________________________________________________________//
+
 // EOF

Modified: trunk/libs/test/test/token_iterator_test.cpp
==============================================================================
--- trunk/libs/test/test/token_iterator_test.cpp (original)
+++ trunk/libs/test/test/token_iterator_test.cpp 2008-07-24 23:55:03 EDT (Thu, 24 Jul 2008)
@@ -1,4 +1,4 @@
-// (C) Copyright Gennadiy Rozental 2001-2007.
+// (C) Copyright Gennadiy Rozental 2001-2008.
 // Distributed under 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)

Modified: trunk/libs/test/tools/console_test_runner/src/console_test_runner.cpp
==============================================================================
--- trunk/libs/test/tools/console_test_runner/src/console_test_runner.cpp (original)
+++ trunk/libs/test/tools/console_test_runner/src/console_test_runner.cpp 2008-07-24 23:55:03 EDT (Thu, 24 Jul 2008)
@@ -1,4 +1,4 @@
-// (C) Copyright Gennadiy Rozental 2005.
+// (C) Copyright Gennadiy Rozental 2005-2007.
 // Distributed under 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)

Modified: trunk/libs/test/tools/console_test_runner/test/test_runner_test.cpp
==============================================================================
--- trunk/libs/test/tools/console_test_runner/test/test_runner_test.cpp (original)
+++ trunk/libs/test/tools/console_test_runner/test/test_runner_test.cpp 2008-07-24 23:55:03 EDT (Thu, 24 Jul 2008)
@@ -1,4 +1,4 @@
-// (C) Copyright Gennadiy Rozental 2005.
+// (C) Copyright Gennadiy Rozental 2005-2007.
 // Distributed under 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)


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