Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r81144 - in trunk/libs/test/test: . test_files
From: gennadiy.rozental_at_[hidden]
Date: 2012-11-02 01:56:39


Author: rogeeff
Date: 2012-11-02 01:56:36 EDT (Fri, 02 Nov 2012)
New Revision: 81144
URL: http://svn.boost.org/trac/boost/changeset/81144

Log:
portable pattern
Text files modified:
   trunk/libs/test/test/test_files/test_tools_test.pattern | 54 ++++++++++++++++++++--------------------
   trunk/libs/test/test/test_tools_test.cpp | 32 +++++++++++++----------
   2 files changed, 45 insertions(+), 41 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 2012-11-02 01:56:36 EDT (Fri, 02 Nov 2012)
@@ -101,30 +101,30 @@
 636: error: in "test_context_logging": check false failed
 Failure occurred in a following context:
     outer context
-653: info: check true passed
-654: error: in "test_BOOST_TEST_universal": check false failed
-657: info: check bc passed
-660: error: in "test_BOOST_TEST_universal": check i == 2 failed [1!=2]
-661: error: in "test_BOOST_TEST_universal": check i != 1 failed [1==1]
-662: error: in "test_BOOST_TEST_universal": check i > 2 failed [1<=2]
-663: error: in "test_BOOST_TEST_universal": check i < 1 failed [1>=1]
-664: error: in "test_BOOST_TEST_universal": check i <= 0 failed [1>0]
-665: error: in "test_BOOST_TEST_universal": check i >= 5 failed [1<5]
-669: error: in "test_BOOST_TEST_universal": check i+j >= 5 failed [1+2<5]
-670: error: in "test_BOOST_TEST_universal": check j-i == 2 failed [2-1!=2]
-674: error: in "test_BOOST_TEST_universal": check *p == 2 failed [1!=2]
-677: error: in "test_BOOST_TEST_universal": check j-*p == 0 failed [2-1!=0]
-680: info: check ( i > 5, true ) passed
-684: error: in "test_BOOST_TEST_universal": check FooType() failed [(bool)0 is false]
-685: error: in "test_BOOST_TEST_universal": check *F failed [(bool)0 is false]
-686: error: in "test_BOOST_TEST_universal": check **F failed [(bool)0 is false]
-687: error: in "test_BOOST_TEST_universal": check ***F failed [(bool)0 is false]
-688: error: in "test_BOOST_TEST_universal": check &F > 100 failed [10<=100]
-689: error: in "test_BOOST_TEST_universal": check &*F > 100 failed [10<=100]
-692: error: in "test_BOOST_TEST_universal": check (i == 1) & (j == 1) failed [1&0]
-693: error: in "test_BOOST_TEST_universal": check (i == 2) | (j == 1) failed [0|0]
-696: error: in "test_BOOST_TEST_universal": check ( i == 1 && j == 1 ) failed
-697: error: in "test_BOOST_TEST_universal": check ( i == 2 || j == 1 ) failed
-700: error: in "test_BOOST_TEST_universal": This message reported instead
-705: info: check true passed
-711: info: check true passed
+665: info: check true passed
+666: error: in "test_BOOST_TEST_universal": check false failed
+669: info: check bc passed
+672: error: in "test_BOOST_TEST_universal": check i == 2 failed [1!=2]
+673: error: in "test_BOOST_TEST_universal": check i != 1 failed [1==1]
+674: error: in "test_BOOST_TEST_universal": check i > 2 failed [1<=2]
+675: error: in "test_BOOST_TEST_universal": check i < 1 failed [1>=1]
+676: error: in "test_BOOST_TEST_universal": check i <= 0 failed [1>0]
+677: error: in "test_BOOST_TEST_universal": check i >= 5 failed [1<5]
+680: error: in "test_BOOST_TEST_universal": check i+j >= 5 failed [1+2<5]
+681: error: in "test_BOOST_TEST_universal": check j-i == 2 failed [2-1!=2]
+684: error: in "test_BOOST_TEST_universal": check *p == 2 failed [1!=2]
+686: error: in "test_BOOST_TEST_universal": check j-*p == 0 failed [2-1!=0]
+688: info: check ( i > 5, true ) passed
+692: error: in "test_BOOST_TEST_universal": check FooType() failed [(bool)0 is false]
+693: error: in "test_BOOST_TEST_universal": check *F failed [(bool)0 is false]
+694: error: in "test_BOOST_TEST_universal": check **F failed [(bool)0 is false]
+695: error: in "test_BOOST_TEST_universal": check ***F failed [(bool)0 is false]
+696: error: in "test_BOOST_TEST_universal": check &F > 100 failed [10<=100]
+697: error: in "test_BOOST_TEST_universal": check &*F > 100 failed [10<=100]
+699: error: in "test_BOOST_TEST_universal": check (i == 1) & (j == 1) failed [1&0]
+700: error: in "test_BOOST_TEST_universal": check (i == 2) | (j == 1) failed [0|0]
+702: error: in "test_BOOST_TEST_universal": check ( i == 1 && j == 1 ) failed
+703: error: in "test_BOOST_TEST_universal": check ( i == 2 || j == 1 ) failed
+705: error: in "test_BOOST_TEST_universal": This message reported instead
+709: info: check true passed
+715: info: check true passed

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 2012-11-02 01:56:36 EDT (Fri, 02 Nov 2012)
@@ -646,6 +646,18 @@
     int operator&() { return 10; }
 };
 
+#ifndef BOOST_NO_DECLTYPE
+#define BOOST_TEST_FWD_1(P,M) BOOST_TEST(P)
+#else
+#define BOOST_TEST_FWD_1(P,M) BOOST_CHECK_MESSAGE( P, M );
+#endif
+
+#if BOOST_PP_VARIADICS
+#define BOOST_TEST_FWD_2(P,M) BOOST_TEST(P,M)
+#else
+#define BOOST_TEST_FWD_2(P,M) BOOST_CHECK_MESSAGE( P, M );
+#endif
+
 TEST_CASE( test_BOOST_TEST_universal )
 {
     unit_test_log.set_threshold_level( log_successful_tests );
@@ -665,17 +677,13 @@
     BOOST_TEST( i >= 5 );
 
     int j = 2;
-#ifdef BOOST_HAS_DECLTYPE
- BOOST_TEST( i+j >= 5 );
- BOOST_TEST( j-i == 2 );
-#endif
+ BOOST_TEST_FWD_1( i+j >= 5, "check i+j >= 5 failed [1+2<5]" );
+ BOOST_TEST_FWD_1( j-i == 2, "check j-i == 2 failed [2-1!=2]" );
 
     int* p = &i;
     BOOST_TEST( *p == 2 );
 
-#ifdef BOOST_HAS_DECLTYPE
- BOOST_TEST( j-*p == 0 );
-#endif
+ BOOST_TEST_FWD_1( j-*p == 0, "check j-*p == 0 failed [2-1!=0]" );
 
     BOOST_TEST(( i > 5, true ));
 
@@ -688,17 +696,13 @@
     BOOST_TEST( &F > 100 );
     BOOST_TEST( &*F > 100 );
 
-#ifdef BOOST_HAS_DECLTYPE
- BOOST_TEST( (i == 1) & (j == 1) );
- BOOST_TEST( (i == 2) | (j == 1) );
-#endif
+ BOOST_TEST_FWD_1( (i == 1) & (j == 1), "check (i == 1) & (j == 1) failed [1&0]" );
+ BOOST_TEST_FWD_1( (i == 2) | (j == 1), "check (i == 2) | (j == 1) failed [0|0]" );
 
     BOOST_TEST(( i == 1 && j == 1 ));
     BOOST_TEST(( i == 2 || j == 1 ));
 
-#if BOOST_PP_VARIADICS
- BOOST_TEST( i+j==15,"This message reported instead");
-#endif
+ BOOST_TEST_FWD_2( i+j==15,"This message reported instead");
 
     // check correct behavior in if clause
     if( true )


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