|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r82719 - in trunk/libs/test/test: . test_datasets_src test_files
From: gennadiy.rozental_at_[hidden]
Date: 2013-02-06 20:25:25
Author: rogeeff
Date: 2013-02-04 03:34:26 EST (Mon, 04 Feb 2013)
New Revision: 82719
URL: http://svn.boost.org/trac/boost/changeset/82719
Log:
Unit test update to reflect previous commit's changes
Text files modified:
trunk/libs/test/test/Jamfile.v2 | 3
trunk/libs/test/test/algorithms_test.cpp | 38 +--
trunk/libs/test/test/basic_cstring_test.cpp | 212 +++++++++++-----------
trunk/libs/test/test/class_properties_test.cpp | 98 +++++-----
trunk/libs/test/test/config_file_iterator_test.cpp | 264 ++++++++++++++--------------
trunk/libs/test/test/config_file_test.cpp | 82 ++++----
trunk/libs/test/test/fixed_mapping_test.cpp | 36 +-
trunk/libs/test/test/ifstream_line_iterator_test.cpp | 14
trunk/libs/test/test/output_test_stream_test.cpp | 92 ++++----
trunk/libs/test/test/result_report_test.cpp | 6
trunk/libs/test/test/run_by_name_label_test.cpp | 4
trunk/libs/test/test/sync_access_test.cpp | 2
trunk/libs/test/test/test_assertion_construction.cpp | 337 +++++++++++++++++++-----------------
trunk/libs/test/test/test_case_template_test.cpp | 26 +-
trunk/libs/test/test/test_datasets_src/test_random.cpp | 4
trunk/libs/test/test/test_files/errors_handling_test.pattern | 2
trunk/libs/test/test/test_files/errors_handling_test.pattern2 | 2
trunk/libs/test/test/test_files/test_tools_test.pattern | 215 +++++++++++++----------
trunk/libs/test/test/test_fp_comparisons.cpp | 57 ++++-
trunk/libs/test/test/test_tools_test.cpp | 369 ++++++++++++++++++++++++++-------------
trunk/libs/test/test/test_tree_management_test.cpp | 3
21 files changed, 1026 insertions(+), 840 deletions(-)
Modified: trunk/libs/test/test/Jamfile.v2
==============================================================================
--- trunk/libs/test/test/Jamfile.v2 (original)
+++ trunk/libs/test/test/Jamfile.v2 2013-02-04 03:34:26 EST (Mon, 04 Feb 2013)
@@ -45,6 +45,7 @@
<toolset>borland:<cxxflags>-w-8080
<toolset>msvc-6.5:<link>static
<toolset>msvc-8.0:<define>_SCL_SECURE_NO_DEPRECATE
+ <toolset>gcc:<cxxflags>-std=gnu++0x
<define>BOOST_TEST_NO_AUTO_LINK=1 # requirements
<threading>multi
<warnings>all
@@ -88,6 +89,8 @@
[ test-btl-lib run : test_assertion_construction : boost_unit_test_framework/<link>static ]
[ test-btl-lib run : test_datasets : boost_unit_test_framework : : [ glob test_datasets_src/*.cpp ] : ]
[ test-btl-lib run : test_datasets_cxx11 : boost_unit_test_framework : : [ glob test_datasets_src/*.cpp ] : : <toolset>gcc:<cxxflags>-std=gnu++0x ]
+ # [ test-btl-lib run : config_file_iterator_test : boost_unit_test_framework/<link>static ]
+ # [ test-btl-lib run : config_file_test : boost_unit_test_framework/<link>static ]
;
test-suite "multithreaded_test"
Modified: trunk/libs/test/test/algorithms_test.cpp
==============================================================================
--- trunk/libs/test/test/algorithms_test.cpp (original)
+++ trunk/libs/test/test/algorithms_test.cpp 2013-02-04 03:34:26 EST (Mon, 04 Feb 2013)
@@ -40,18 +40,17 @@
const_string cs1( "test_string" );
const_string cs2( "test_stream" );
- BOOST_CHECK_EQUAL( utf::mismatch( cs1.begin(), cs1.end(), cs2.begin(), cs2.end() ).first - cs1.begin(), 8 );
+ BOOST_TEST( utf::mismatch( cs1.begin(), cs1.end(), cs2.begin(), cs2.end() ).first - cs1.begin() == 8 );
cs2 = "trest";
- BOOST_CHECK_EQUAL( utf::mismatch( cs1.begin(), cs1.end(), cs2.begin(), cs2.end() ).first - cs1.begin(), 1 );
+ BOOST_TEST( utf::mismatch( cs1.begin(), cs1.end(), cs2.begin(), cs2.end() ).first - cs1.begin() == 1 );
cs2 = "test_string_klmn";
- BOOST_CHECK_EQUAL( utf::mismatch( cs1.begin(), cs1.end(), cs2.begin(), cs2.end() ).first - cs1.begin(), 11 );
+ BOOST_TEST( utf::mismatch( cs1.begin(), cs1.end(), cs2.begin(), cs2.end() ).first - cs1.begin() == 11 );
cs2 = "TeSt_liNk";
- BOOST_CHECK_EQUAL(
- utf::mismatch( cs1.begin(), cs1.end(), cs2.begin(), cs2.end(), std::ptr_fun( predicate ) ).first - cs1.begin(),
- 5 );
+ BOOST_TEST(
+ utf::mismatch( cs1.begin(), cs1.end(), cs2.begin(), cs2.end(), std::ptr_fun( predicate ) ).first - cs1.begin() == 5 );
}
//____________________________________________________________________________//
@@ -61,15 +60,14 @@
const_string cs( "test_string" );
const_string another( "tes" );
- BOOST_CHECK_EQUAL( utf::find_first_not_of( cs.begin(), cs.end(), another.begin(), another.end() ) - cs.begin(), 4 );
+ BOOST_TEST( utf::find_first_not_of( cs.begin(), cs.end(), another.begin(), another.end() ) - cs.begin() == 4 );
another = "T_sE";
- BOOST_CHECK_EQUAL(
- utf::find_first_not_of( cs.begin(), cs.end(), another.begin(), another.end(), std::ptr_fun( predicate ) ) - cs.begin(),
- 7 );
+ BOOST_TEST(
+ utf::find_first_not_of( cs.begin(), cs.end(), another.begin(), another.end(), std::ptr_fun( predicate ) ) - cs.begin() == 7 );
another = "tes_ring";
- BOOST_CHECK( utf::find_last_not_of( cs.begin(), cs.end(), another.begin(), another.end() ) == cs.end() );
+ BOOST_TEST( utf::find_last_not_of( cs.begin(), cs.end(), another.begin(), another.end() ) == cs.end() );
}
//____________________________________________________________________________//
@@ -79,18 +77,16 @@
const_string cs( "test_string" );
const_string another( "tes" );
- BOOST_CHECK_EQUAL( utf::find_last_of( cs.begin(), cs.end(), another.begin(), another.end() ) - cs.begin(), 6 );
+ BOOST_TEST( utf::find_last_of( cs.begin(), cs.end(), another.begin(), another.end() ) - cs.begin() == 6 );
another = "_Se";
- BOOST_CHECK_EQUAL(
- utf::find_last_of( cs.begin(), cs.end(), another.begin(), another.end(), std::ptr_fun( predicate ) ) - cs.begin(),
- 5 );
+ BOOST_TEST( utf::find_last_of( cs.begin(), cs.end(), another.begin(), another.end(), std::ptr_fun( predicate ) ) - cs.begin() == 5 );
another = "qw";
- BOOST_CHECK( utf::find_last_of( cs.begin(), cs.end(), another.begin(), another.end() ) == cs.end() );
+ BOOST_TEST( utf::find_last_of( cs.begin(), cs.end(), another.begin(), another.end() ) == cs.end() );
cs = "qerty";
- BOOST_CHECK_EQUAL( utf::find_last_of( cs.begin(), cs.end(), another.begin(), another.end() ) - cs.begin(), 0 );
+ BOOST_TEST( utf::find_last_of( cs.begin(), cs.end(), another.begin(), another.end() ) - cs.begin() == 0 );
}
//____________________________________________________________________________//
@@ -100,15 +96,13 @@
const_string cs( "test_string" );
const_string another( "string" );
- BOOST_CHECK_EQUAL( utf::find_last_not_of( cs.begin(), cs.end(), another.begin(), another.end() ) - cs.begin(), 4 );
+ BOOST_TEST( utf::find_last_not_of( cs.begin(), cs.end(), another.begin(), another.end() ) - cs.begin() == 4 );
another = "_SeG";
- BOOST_CHECK_EQUAL(
- utf::find_last_not_of( cs.begin(), cs.end(), another.begin(), another.end(), std::ptr_fun( predicate ) ) - cs.begin(),
- 9 );
+ BOOST_TEST( utf::find_last_not_of( cs.begin(), cs.end(), another.begin(), another.end(), std::ptr_fun( predicate ) ) - cs.begin() == 9 );
another = "e_string";
- BOOST_CHECK( utf::find_last_not_of( cs.begin(), cs.end(), another.begin(), another.end() ) == cs.end() );
+ BOOST_TEST( utf::find_last_not_of( cs.begin(), cs.end(), another.begin(), another.end() ) == cs.end() );
}
//____________________________________________________________________________//
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 2013-02-04 03:34:26 EST (Mon, 04 Feb 2013)
@@ -94,45 +94,45 @@
{
{
utf::basic_cstring<CharT> bcs;
- BOOST_CHECK_EQUAL( bcs.size(), (unsigned)0 );
- BOOST_CHECK( bcs.is_empty() );
+ BOOST_TEST( bcs.size() == 0U );
+ BOOST_TEST( bcs.is_empty() );
}
{
utf::basic_cstring<CharT> bcs( utf::basic_cstring<CharT>::null_str() );
- BOOST_CHECK_EQUAL( bcs.size(), (unsigned)0 );
- BOOST_CHECK( bcs.is_empty() );
+ BOOST_TEST( bcs.size() == 0U );
+ BOOST_TEST( bcs.is_empty() );
}
{
utf::basic_cstring<CharT> bcs( 0 );
- BOOST_CHECK_EQUAL( bcs.size(), (unsigned)0 );
- BOOST_CHECK( bcs.is_empty() );
+ BOOST_TEST( bcs.size() == 0U );
+ BOOST_TEST( bcs.is_empty() );
}
{
typedef typename utf::basic_cstring<CharT>::traits_type traits;
utf::basic_cstring<CharT> bcs( TEST_STRING );
- BOOST_CHECK_EQUAL( traits::compare( bcs.begin(), TEST_STRING, bcs.size() ), 0 );
- BOOST_CHECK_EQUAL( bcs.size(), traits::length( TEST_STRING ) );
+ BOOST_TEST( traits::compare( bcs.begin(), TEST_STRING, bcs.size() ) == 0 );
+ BOOST_TEST( bcs.size() == traits::length( TEST_STRING ) );
utf::basic_cstring<CharT> bcs1( bcs );
- BOOST_CHECK_EQUAL( traits::compare( bcs1.begin(), TEST_STRING, bcs1.size() ), 0 );
+ BOOST_TEST( traits::compare( bcs1.begin(), TEST_STRING, bcs1.size() ) == 0 );
}
{
typedef typename utf::basic_cstring<CharT>::traits_type traits;
utf::basic_cstring<CharT> bcs( TEST_STRING, 4 );
- BOOST_CHECK_EQUAL( traits::compare( bcs.begin(), LITERAL( "test" ), bcs.size() ), 0 );
+ BOOST_TEST( traits::compare( bcs.begin(), LITERAL( "test" ), bcs.size() ) == 0 );
}
{
typedef typename utf::basic_cstring<CharT>::traits_type traits;
utf::basic_cstring<CharT> bcs( TEST_STRING, TEST_STRING + 6 );
- BOOST_CHECK_EQUAL( traits::compare( bcs.begin(), LITERAL( "test_s" ), bcs.size() ), 0 );
+ BOOST_TEST( traits::compare( bcs.begin(), LITERAL( "test_s" ), bcs.size() ) == 0 );
}
}
@@ -146,7 +146,7 @@
typename utf::basic_cstring<CharT>::std_string l( TEST_STRING );
utf::basic_cstring<CharT> bcs( l );
- BOOST_CHECK_EQUAL( traits::compare( bcs.begin(), TEST_STRING, bcs.size() ), 0 );
+ BOOST_TEST( traits::compare( bcs.begin(), TEST_STRING, bcs.size() ) == 0 );
}
}
@@ -158,11 +158,11 @@
#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x600))
const_string bcs_array[] = { "str1", "str2" };
- BOOST_CHECK_EQUAL( const_string::traits_type::compare( bcs_array[0].begin(), "str1", bcs_array[0].size() ), 0 );
- BOOST_CHECK_EQUAL( const_string::traits_type::compare( bcs_array[1].begin(), "str2", bcs_array[1].size() ), 0 );
+ BOOST_TEST( const_string::traits_type::compare( bcs_array[0].begin(), "str1", bcs_array[0].size() ) == 0 );
+ BOOST_TEST( const_string::traits_type::compare( bcs_array[1].begin(), "str2", bcs_array[1].size() ) == 0 );
const_string bcs( "abc" );
- BOOST_CHECK_EQUAL( const_string::traits_type::compare( bcs.begin(), "abc", bcs.size() ), 0 );
+ BOOST_TEST( const_string::traits_type::compare( bcs.begin(), "abc", bcs.size() ) == 0 );
#endif
}
@@ -173,24 +173,24 @@
typedef typename utf::basic_cstring<CharT>::traits_type traits_type;
utf::basic_cstring<CharT> bcs1( TEST_STRING );
- BOOST_CHECK_EQUAL( traits_type::compare( bcs1.begin(), TEST_STRING, bcs1.size() ), 0 );
- BOOST_CHECK_EQUAL( traits_type::compare( bcs1.begin(), bcs1.begin(), bcs1.size() ), 0 );
+ BOOST_TEST( traits_type::compare( bcs1.begin(), TEST_STRING, bcs1.size() ) == 0 );
+ BOOST_TEST( traits_type::compare( bcs1.begin(), bcs1.begin(), bcs1.size() ) == 0 );
- BOOST_CHECK_EQUAL( bcs1[0], 't' );
- BOOST_CHECK_EQUAL( bcs1[4], '_' );
- BOOST_CHECK_EQUAL( bcs1[bcs1.size()-1], 'g' );
-
- BOOST_CHECK_EQUAL( bcs1[0], bcs1.at( 0 ) );
- BOOST_CHECK_EQUAL( bcs1[2], bcs1.at( 5 ) );
- BOOST_CHECK_EQUAL( bcs1.at( bcs1.size() - 1 ), 'g' );
- BOOST_CHECK_EQUAL( bcs1.at( bcs1.size() ), 0 );
- BOOST_CHECK_EQUAL( bcs1.at( bcs1.size()+1 ), 0 );
+ BOOST_TEST( bcs1[0] == 't' );
+ BOOST_TEST( bcs1[4] == '_' );
+ BOOST_TEST( bcs1[bcs1.size()-1] == 'g' );
+
+ BOOST_TEST( bcs1[0] == bcs1.at( 0 ) );
+ BOOST_TEST( bcs1[2] == bcs1.at( 5 ) );
+ BOOST_TEST( bcs1.at( bcs1.size() - 1 ) == 'g' );
+ BOOST_TEST( bcs1.at( bcs1.size() ) == 0 );
+ BOOST_TEST( bcs1.at( bcs1.size()+1 ) == 0 );
- BOOST_CHECK_EQUAL( utf::first_char( bcs1 ), 't' );
- BOOST_CHECK_EQUAL( utf::last_char( bcs1 ) , 'g' );
+ BOOST_TEST( utf::first_char( bcs1 ) == 't' );
+ BOOST_TEST( utf::last_char( bcs1 ) == 'g' );
- BOOST_CHECK_EQUAL( utf::first_char( utf::basic_cstring<CharT>() ), 0 );
- BOOST_CHECK_EQUAL( utf::last_char( utf::basic_cstring<CharT>() ), 0 );
+ BOOST_TEST( utf::first_char( utf::basic_cstring<CharT>() ) == 0 );
+ BOOST_TEST( utf::last_char( utf::basic_cstring<CharT>() ) == 0 );
}
//____________________________________________________________________________//
@@ -199,24 +199,24 @@
{
utf::basic_cstring<CharT> bcs1;
- BOOST_CHECK_EQUAL( bcs1.size(), (unsigned)0 );
- BOOST_CHECK( bcs1.is_empty() );
+ BOOST_TEST( bcs1.size() == 0U );
+ BOOST_TEST( bcs1.is_empty() );
bcs1 = TEST_STRING;
- BOOST_CHECK_EQUAL( bcs1.size(), (unsigned)11 );
+ BOOST_TEST( bcs1.size() == 11U );
bcs1.clear();
- BOOST_CHECK_EQUAL( bcs1.size(), (unsigned)0 );
- BOOST_CHECK( bcs1.is_empty() );
+ BOOST_TEST( bcs1.size() == 0U );
+ BOOST_TEST( bcs1.is_empty() );
bcs1 = utf::basic_cstring<CharT>( TEST_STRING, 4 );
- BOOST_CHECK_EQUAL( bcs1.size(), (unsigned)4 );
+ BOOST_TEST( bcs1.size() == 4U );
bcs1.resize( 5 );
- BOOST_CHECK_EQUAL( bcs1.size(), (unsigned)4 );
+ BOOST_TEST( bcs1.size() == 4U );
bcs1.resize( 3 );
- BOOST_CHECK_EQUAL( bcs1.size(), (unsigned)3 );
+ BOOST_TEST( bcs1.size() == 3U );
}
//____________________________________________________________________________//
@@ -229,24 +229,24 @@
string_literal<CharT> l( "test", 4 );
bcs1 = l.buff;
- BOOST_CHECK_EQUAL( traits_type::compare( bcs1.begin(), LITERAL( "test" ), bcs1.size() ), 0 );
+ BOOST_TEST( traits_type::compare( bcs1.begin(), LITERAL( "test" ), bcs1.size() ) == 0 );
utf::basic_cstring<CharT> bcs2( TEST_STRING );
bcs1 = bcs2;
- BOOST_CHECK_EQUAL( traits_type::compare( bcs1.begin(), TEST_STRING, bcs1.size() ), 0 );
+ BOOST_TEST( traits_type::compare( bcs1.begin(), TEST_STRING, bcs1.size() ) == 0 );
bcs1.assign( l.buff );
- BOOST_CHECK_EQUAL( traits_type::compare( bcs1.begin(), LITERAL( "test" ), bcs1.size() ), 0 );
+ BOOST_TEST( traits_type::compare( bcs1.begin(), LITERAL( "test" ), bcs1.size() ) == 0 );
bcs1.assign( l.buff+1, l.buff+3 );
- BOOST_CHECK_EQUAL( traits_type::compare( bcs1.begin(), LITERAL( "est" ), bcs1.size() ), 0 );
+ BOOST_TEST( traits_type::compare( bcs1.begin(), LITERAL( "est" ), bcs1.size() ) == 0 );
bcs1.assign( bcs2, 4, 3 );
- BOOST_CHECK_EQUAL( traits_type::compare( bcs1.begin(), LITERAL( "_st" ), bcs1.size() ), 0 );
+ BOOST_TEST( traits_type::compare( bcs1.begin(), LITERAL( "_st" ), bcs1.size() ) == 0 );
bcs1.swap( bcs2 );
- BOOST_CHECK_EQUAL( traits_type::compare( bcs1.begin(), TEST_STRING, bcs1.size() ), 0 );
- BOOST_CHECK_EQUAL( traits_type::compare( bcs2.begin(), LITERAL( "_st" ), bcs2.size() ), 0 );
+ BOOST_TEST( traits_type::compare( bcs1.begin(), TEST_STRING, bcs1.size() ) == 0 );
+ BOOST_TEST( traits_type::compare( bcs2.begin(), LITERAL( "_st" ), bcs2.size() ) == 0 );
}
//____________________________________________________________________________//
@@ -259,13 +259,13 @@
typename utf::basic_cstring<CharT>::std_string l( TEST_STRING );
bcs1 = l;
- BOOST_CHECK_EQUAL( traits_type::compare( bcs1.begin(), TEST_STRING, bcs1.size() ), 0 );
+ BOOST_TEST( traits_type::compare( bcs1.begin(), TEST_STRING, bcs1.size() ) == 0 );
bcs1.assign( l );
- BOOST_CHECK_EQUAL( traits_type::compare( bcs1.begin(), TEST_STRING, bcs1.size() ), 0 );
+ BOOST_TEST( traits_type::compare( bcs1.begin(), TEST_STRING, bcs1.size() ) == 0 );
bcs1.assign( l, 1, 2 );
- BOOST_CHECK_EQUAL( traits_type::compare( bcs1.begin(), LITERAL( "es" ), bcs1.size() ), 0 );
+ BOOST_TEST( traits_type::compare( bcs1.begin(), LITERAL( "es" ), bcs1.size() ) == 0 );
}
//____________________________________________________________________________//
@@ -275,40 +275,38 @@
utf::basic_cstring<CharT> bcs1( TEST_STRING );
utf::basic_cstring<CharT> bcs2( TEST_STRING );
- BOOST_CHECK_EQUAL( bcs1, TEST_STRING );
- BOOST_CHECK_EQUAL( TEST_STRING, bcs1 );
- BOOST_CHECK_EQUAL( bcs1, bcs2 );
+ BOOST_TEST(( bcs1 == TEST_STRING ));
+ BOOST_TEST(( TEST_STRING == bcs1 ));
+ BOOST_TEST(( bcs1 == bcs2 ));
bcs1.resize( 4 );
- BOOST_CHECK_EQUAL( bcs1, LITERAL( "test" ) );
+ BOOST_TEST(( bcs1 == LITERAL( "test" ) ));
- BOOST_CHECK( bcs1 != TEST_STRING );
- BOOST_CHECK( TEST_STRING != bcs1 );
- BOOST_CHECK( bcs1 != bcs2 );
+ BOOST_TEST(( bcs1 != TEST_STRING ));
+ BOOST_TEST(( TEST_STRING != bcs1 ));
+ BOOST_TEST(( bcs1 != bcs2 ));
LOCAL_DEF( bcs3, "TeSt" );
- BOOST_CHECK( utf::case_ins_eq( bcs1, bcs3 ) );
+ BOOST_TEST( utf::case_ins_eq( bcs1, bcs3 ) );
}
//____________________________________________________________________________//
+BOOST_TEST_DONT_PRINT_LOG_VALUE( std::wstring );
+
BOOST_TEST_CASE_TEMPLATE_FUNCTION( comparison_std_string_test, CharT )
{
utf::basic_cstring<CharT> bcs1( TEST_STRING );
typename utf::basic_cstring<CharT>::std_string l( TEST_STRING );
- BOOST_CHECK( bcs1 == l );
-#if BOOST_WORKAROUND(BOOST_MSVC, > 1300)
- BOOST_CHECK( l == bcs1 );
-#endif
+ BOOST_TEST( bcs1 == l );
+ BOOST_TEST( l == bcs1 );
bcs1.resize( 4 );
- BOOST_CHECK( bcs1 != l );
-#if BOOST_WORKAROUND(BOOST_MSVC, > 1300)
- BOOST_CHECK( l != bcs1 );
-#endif
+ BOOST_TEST( bcs1 != l );
+ BOOST_TEST( l != bcs1 );
}
//____________________________________________________________________________//
@@ -320,13 +318,13 @@
LOCAL_DEF( bcs3, "aBbde" );
LOCAL_DEF( bcs4, "abab" );
- BOOST_CHECK( bcs1 < bcs2 );
- BOOST_CHECK( bcs2 < bcs3 );
- BOOST_CHECK( bcs1 < bcs3 );
- BOOST_CHECK( bcs1 < bcs4 );
+ BOOST_TEST(( bcs1 < bcs2 ));
+ BOOST_TEST(( bcs2 < bcs3 ));
+ BOOST_TEST(( bcs1 < bcs3 ));
+ BOOST_TEST(( bcs1 < bcs4 ));
utf::case_ins_less<CharT> cil;
- BOOST_CHECK( cil( bcs4, bcs1 ) );
+ BOOST_TEST( cil( bcs4, bcs1 ) );
}
//____________________________________________________________________________//
@@ -336,49 +334,49 @@
LOCAL_DEF( bcs0, "tes" );
bcs0.trim_right( 1 );
- BOOST_CHECK_EQUAL( bcs0.size(), (unsigned)2 );
- BOOST_CHECK_EQUAL( bcs0[0], 't' );
+ BOOST_TEST( bcs0.size() == 2U );
+ BOOST_TEST( bcs0[0] == 't' );
bcs0.trim_left( 1 );
- BOOST_CHECK_EQUAL( bcs0.size(), (unsigned)1 );
- BOOST_CHECK_EQUAL( bcs0[0], 'e' );
+ BOOST_TEST( bcs0.size() == 1U );
+ BOOST_TEST( bcs0[0] == 'e' );
bcs0.trim_left( 1 );
- BOOST_CHECK( bcs0.is_empty() );
+ BOOST_TEST( bcs0.is_empty() );
bcs0 = TEST_STRING;
bcs0.trim_left( 11 );
- BOOST_CHECK( bcs0.is_empty() );
+ BOOST_TEST( bcs0.is_empty() );
bcs0 = TEST_STRING;
bcs0.trim_right( 11 );
- BOOST_CHECK( bcs0.is_empty() );
+ BOOST_TEST( bcs0.is_empty() );
bcs0 = TEST_STRING;
bcs0.trim_right( bcs0.size() - bcs0.find( LITERAL( "t_s" ) ) - 3 );
- BOOST_CHECK_EQUAL( bcs0, LITERAL( "test_s" ) );
+ BOOST_TEST( bcs0 == LITERAL( "test_s" ) );
bcs0.trim_left( bcs0.find( LITERAL( "t_s" ) ) );
- BOOST_CHECK_EQUAL( bcs0, LITERAL( "t_s" ) );
+ BOOST_TEST( bcs0 == LITERAL( "t_s" ) );
LOCAL_DEF( bcs1, "abcd " );
LOCAL_DEF( bcs2, " abcd" );
LOCAL_DEF( bcs3, " abcd " );
bcs1.trim_right();
- BOOST_CHECK_EQUAL( bcs1, LITERAL( "abcd" ) );
+ BOOST_TEST( bcs1 == LITERAL( "abcd" ) );
bcs2.trim_left();
- BOOST_CHECK_EQUAL( bcs2, LITERAL( "abcd" ) );
+ BOOST_TEST( bcs2 == LITERAL( "abcd" ) );
bcs3.trim( LITERAL( "\"" ) );
- BOOST_CHECK_EQUAL( bcs3, LITERAL( " abcd " ) );
+ BOOST_TEST( bcs3 == LITERAL( " abcd " ) );
bcs3.trim();
- BOOST_CHECK_EQUAL( bcs3, LITERAL( "abcd" ) );
+ BOOST_TEST( bcs3 == LITERAL( "abcd" ) );
bcs3.trim();
- BOOST_CHECK_EQUAL( bcs3, LITERAL( "abcd" ) );
+ BOOST_TEST( bcs3 == LITERAL( "abcd" ) );
}
//____________________________________________________________________________//
@@ -391,13 +389,13 @@
tt::output_test_stream ostr;
ostr << std::setw( 6 ) << bcs1;
- BOOST_CHECK( ostr.is_equal( " test" ) );
+ BOOST_TEST( ostr.is_equal( " test" ) );
ostr << std::setw( 3 ) << bcs1;
- BOOST_CHECK( ostr.is_equal( "test" ) );
+ BOOST_TEST( ostr.is_equal( "test" ) );
ostr << std::setw( 5 ) << std::setiosflags( std::ios::left ) << bcs1;
- BOOST_CHECK( ostr.is_equal( "test " ) );
+ BOOST_TEST( ostr.is_equal( "test " ) );
}
//____________________________________________________________________________//
@@ -409,25 +407,25 @@
size not_found = (size)utf::basic_cstring<CharT>::npos;
- BOOST_CHECK_EQUAL( bcs1.find( utf::basic_cstring<CharT>() ), not_found );
- BOOST_CHECK_EQUAL( bcs1.find( LITERAL( "test" ) ), (size)0 );
- BOOST_CHECK_EQUAL( bcs1.find( TEST_STRING ), (size)0 );
- BOOST_CHECK_EQUAL( bcs1.find( LITERAL( "test_string " ) ), not_found );
- BOOST_CHECK_EQUAL( bcs1.find( LITERAL( " test_string" ) ), not_found );
- BOOST_CHECK_EQUAL( bcs1.find( LITERAL( "est" ) ), (size)1 );
- BOOST_CHECK_EQUAL( bcs1.find( LITERAL( "t_st" ) ), (size)3 );
- BOOST_CHECK_EQUAL( bcs1.find( LITERAL( "ing" ) ), (size)8 );
- BOOST_CHECK_EQUAL( bcs1.find( LITERAL( "tst" ) ), not_found );
-
- BOOST_CHECK_EQUAL( bcs1.rfind( utf::basic_cstring<CharT>() ), not_found );
- BOOST_CHECK_EQUAL( bcs1.rfind( LITERAL( "test" ) ), (size)0 );
- BOOST_CHECK_EQUAL( bcs1.rfind( TEST_STRING ), (size)0 );
- BOOST_CHECK_EQUAL( bcs1.rfind( LITERAL( "test_string " ) ), not_found );
- BOOST_CHECK_EQUAL( bcs1.rfind( LITERAL( " test_string" ) ), not_found );
- BOOST_CHECK_EQUAL( bcs1.rfind( LITERAL( "est" ) ), (size)1 );
- BOOST_CHECK_EQUAL( bcs1.rfind( LITERAL( "t_st" ) ), (size)3 );
- BOOST_CHECK_EQUAL( bcs1.rfind( LITERAL( "ing" ) ), (size)8 );
- BOOST_CHECK_EQUAL( bcs1.rfind( LITERAL( "tst" ) ), not_found );
+ BOOST_TEST( bcs1.find( utf::basic_cstring<CharT>() ) == not_found );
+ BOOST_TEST( bcs1.find( LITERAL( "test" ) ) == (size)0 );
+ BOOST_TEST( bcs1.find( TEST_STRING ) == (size)0 );
+ BOOST_TEST( bcs1.find( LITERAL( "test_string " ) ) == not_found );
+ BOOST_TEST( bcs1.find( LITERAL( " test_string" ) ) == not_found );
+ BOOST_TEST( bcs1.find( LITERAL( "est" ) ) == (size)1 );
+ BOOST_TEST( bcs1.find( LITERAL( "t_st" ) ) == (size)3 );
+ BOOST_TEST( bcs1.find( LITERAL( "ing" ) ) == (size)8 );
+ BOOST_TEST( bcs1.find( LITERAL( "tst" ) ) == not_found );
+
+ BOOST_TEST( bcs1.rfind( utf::basic_cstring<CharT>() ) == not_found );
+ BOOST_TEST( bcs1.rfind( LITERAL( "test" ) ) == (size)0 );
+ BOOST_TEST( bcs1.rfind( TEST_STRING ) == (size)0 );
+ BOOST_TEST( bcs1.rfind( LITERAL( "test_string " ) ) == not_found );
+ BOOST_TEST( bcs1.rfind( LITERAL( " test_string" ) ) == not_found );
+ BOOST_TEST( bcs1.rfind( LITERAL( "est" ) ) == (size)1 );
+ BOOST_TEST( bcs1.rfind( LITERAL( "t_st" ) ) == (size)3 );
+ BOOST_TEST( bcs1.rfind( LITERAL( "ing" ) ) == (size)8 );
+ BOOST_TEST( bcs1.rfind( LITERAL( "tst" ) ) == not_found );
}
//____________________________________________________________________________//
@@ -441,8 +439,8 @@
str2.assign( str1 );
- BOOST_CHECK_EQUAL( str1, "ABC" );
- BOOST_CHECK_EQUAL( str2, "ABC" );
+ BOOST_TEST( str1 == "ABC" );
+ BOOST_TEST( str2 == "ABC" );
}
//____________________________________________________________________________//
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 2013-02-04 03:34:26 EST (Mon, 04 Feb 2013)
@@ -78,74 +78,74 @@
readonly_property<B> p_b;
readonly_property<A> p_a;
- BOOST_CHECK( p_one );
- BOOST_CHECK( !!p_one );
+ BOOST_TEST( p_one );
+ BOOST_TEST( !!p_one );
int i = p_one;
- BOOST_CHECK( p_one == i );
+ BOOST_TEST( p_one == i );
double d = p_one;
- BOOST_CHECK( p_one == d );
+ BOOST_TEST( p_one == d );
- BOOST_CHECK( p_one != 0 );
- BOOST_CHECK( 0 != p_one );
- BOOST_CHECK( !(p_one == 0) );
- BOOST_CHECK( !(0 == p_one) );
+ BOOST_TEST( p_one != 0 );
+ BOOST_TEST( 0 != p_one );
+ BOOST_TEST( !(p_one == 0) );
+ BOOST_TEST( !(0 == p_one) );
float fzero = 0;
- BOOST_CHECK( p_one != fzero );
- BOOST_CHECK( fzero != p_one );
+ BOOST_TEST( p_one != fzero );
+ BOOST_TEST( fzero != p_one );
- BOOST_CHECK( p_one >= 1 );
- BOOST_CHECK( 2 > p_one );
+ BOOST_TEST( p_one >= 1 );
+ BOOST_TEST( 2 > p_one );
- BOOST_CHECK( !(p_one == p_two) );
- BOOST_CHECK( p_one != p_two );
- BOOST_CHECK( p_one < p_two );
+ BOOST_TEST( !(p_one == p_two) );
+ BOOST_TEST( p_one != p_two );
+ BOOST_TEST( p_one < p_two );
- BOOST_CHECK_EQUAL( p_zero, 0 );
+ BOOST_TEST( p_zero == 0 );
- BOOST_CHECK( (p_one - 1) == 0 );
- BOOST_CHECK( (-p_one + 1) == 0 );
+ BOOST_TEST( (p_one - 1) == 0 );
+ BOOST_TEST( (-p_one + 1) == 0 );
- BOOST_CHECK( p_true );
- BOOST_CHECK( !p_false );
+ BOOST_TEST( p_true );
+ BOOST_TEST( !p_false );
- BOOST_CHECK( (i > 0) && p_true );
- BOOST_CHECK( p_true && (i > 0) );
- BOOST_CHECK( (i > 0) || p_false );
- BOOST_CHECK( p_false || (i > 0) );
+ BOOST_TEST(( (i > 0) && p_true ));
+ BOOST_TEST(( p_true && (i > 0) ));
+ BOOST_TEST(( (i > 0) || p_false ));
+ BOOST_TEST(( p_false || (i > 0) ));
- BOOST_CHECK( a && p_true );
- BOOST_CHECK( a || p_true );
+ BOOST_TEST(( a && p_true ));
+ BOOST_TEST(( a || p_true ));
- BOOST_CHECK( p_true && a );
- BOOST_CHECK( p_true && a );
+ BOOST_TEST(( p_true && a ));
+ BOOST_TEST(( p_true && a ));
std::string s( "abcd" );
- BOOST_CHECK( p_str == s );
- BOOST_CHECK( s == p_str );
- BOOST_CHECK( p_str2 != p_str );
+ BOOST_TEST( p_str == s );
+ BOOST_TEST( s == p_str );
+ BOOST_TEST( p_str2 != p_str );
- BOOST_CHECK_EQUAL( p_b->foo(), 1 );
+ BOOST_TEST( p_b->foo() == 1 );
- BOOST_CHECK_EQUAL( p_one ^ 3, 2 );
- BOOST_CHECK_EQUAL( p_two / 2, 1 );
+ BOOST_TEST( (p_one ^ 3) == 2 );
+ BOOST_TEST( p_two / 2 == 1 );
- BOOST_CHECK( !p_b_ptr );
+ BOOST_TEST( !p_b_ptr );
C::init();
- BOOST_CHECK( p_b_ptr );
+ BOOST_TEST( p_b_ptr );
- BOOST_CHECK( !p_a_ptr );
+ BOOST_TEST( !p_a_ptr );
D::init();
- BOOST_CHECK( p_a_ptr );
+ BOOST_TEST( p_a_ptr );
E::reset();
- BOOST_CHECK( p_a_ptr );
+ BOOST_TEST( p_a_ptr );
if( p_a_ptr )
delete p_a_ptr.get();
@@ -160,29 +160,29 @@
{
readwrite_property<int> p_int;
- BOOST_CHECK( !p_int );
- BOOST_CHECK( p_int == 0 );
- BOOST_CHECK( p_int != 1 );
+ BOOST_TEST( !p_int );
+ BOOST_TEST( p_int == 0 );
+ BOOST_TEST( p_int != 1 );
- BOOST_CHECK( p_int < 5 );
- BOOST_CHECK( p_int >= -5 );
+ BOOST_TEST( p_int < 5 );
+ BOOST_TEST( p_int >= -5 );
p_int.value = 2;
- BOOST_CHECK( p_int == 2 );
- BOOST_CHECK( p_int );
+ BOOST_TEST( p_int == 2 );
+ BOOST_TEST( p_int );
p_int.set( 3 );
- BOOST_CHECK( p_int == 3 );
+ BOOST_TEST( p_int == 3 );
readwrite_property<B> p_bb1;
- BOOST_CHECK_EQUAL( p_bb1->foo(), 2 );
+ BOOST_TEST( p_bb1->foo() == 2 );
readwrite_property<B> const p_bb2;
- BOOST_CHECK_EQUAL( p_bb2->foo(), 1 );
+ BOOST_TEST( p_bb2->foo() == 1 );
}
//____________________________________________________________________________//
Modified: trunk/libs/test/test/config_file_iterator_test.cpp
==============================================================================
--- trunk/libs/test/test/config_file_iterator_test.cpp (original)
+++ trunk/libs/test/test/config_file_iterator_test.cpp 2013-02-04 03:34:26 EST (Mon, 04 Feb 2013)
@@ -32,27 +32,27 @@
{
file::config_file_iterator cfi( NULL );
- BOOST_CHECK( cfi == file::config_file_iterator() );
+ BOOST_TEST( cfi == file::config_file_iterator() );
}
{
file::config_file_iterator cfi( "" );
- BOOST_CHECK( cfi == file::config_file_iterator() );
+ BOOST_TEST( cfi == file::config_file_iterator() );
}
{
rt::cstring cs( "" );
file::config_file_iterator cfi( cs );
- BOOST_CHECK( cfi == file::config_file_iterator() );
+ BOOST_TEST( cfi == file::config_file_iterator() );
}
{
std::string ds;
file::config_file_iterator cfi( ds );
- BOOST_CHECK( cfi == file::config_file_iterator() );
+ BOOST_TEST( cfi == file::config_file_iterator() );
}
{
@@ -62,28 +62,28 @@
{
file::config_file_iterator cfi( "test_files/test_constructor.cfg" );
- BOOST_CHECK( cfi != file::config_file_iterator() );
- BOOST_CHECK_EQUAL( *cfi, "{ abc d }" );
+ BOOST_TEST( cfi != file::config_file_iterator() );
+ BOOST_TEST( *cfi == "{ abc d }" );
cfi = cfi;
- BOOST_CHECK( cfi != file::config_file_iterator() );
- BOOST_CHECK_EQUAL( *cfi, "{ abc d }" );
+ BOOST_TEST( cfi != file::config_file_iterator() );
+ BOOST_TEST( *cfi == "{ abc d }" );
file::config_file_iterator cfi1( cfi );
- BOOST_CHECK( cfi == file::config_file_iterator() );
- BOOST_CHECK_EQUAL( *cfi1, "{ abc d }" );
+ BOOST_TEST( cfi == file::config_file_iterator() );
+ BOOST_TEST( *cfi1 == "{ abc d }" );
++cfi1;
- BOOST_CHECK_EQUAL( *cfi1, "{ d" );
+ BOOST_TEST( *cfi1 == "{ d" );
cfi = cfi1;
- BOOST_CHECK( cfi != file::config_file_iterator() );
- BOOST_CHECK_EQUAL( *cfi, "{ d" );
+ BOOST_TEST( cfi != file::config_file_iterator() );
+ BOOST_TEST( *cfi == "{ d" );
++cfi;
- BOOST_CHECK( *cfi == " dsfg" );
+ BOOST_TEST( *cfi == " dsfg" );
}
}
@@ -93,12 +93,12 @@
{
file::config_file_iterator cfi( "test_files/test_comments_and_blanks.cfg" );
- BOOST_CHECK( cfi != file::config_file_iterator() );
- BOOST_CHECK_EQUAL( *cfi, "1" ); ++cfi;
- BOOST_CHECK_EQUAL( *cfi, "2" ); ++cfi;
- BOOST_CHECK_EQUAL( *cfi, "4" ); ++cfi;
- BOOST_CHECK_EQUAL( *cfi, "3" ); ++cfi;
- BOOST_CHECK( cfi == file::config_file_iterator() );
+ BOOST_TEST( cfi != file::config_file_iterator() );
+ BOOST_TEST( *cfi == "1" ); ++cfi;
+ BOOST_TEST( *cfi == "2" ); ++cfi;
+ BOOST_TEST( *cfi == "4" ); ++cfi;
+ BOOST_TEST( *cfi == "3" ); ++cfi;
+ BOOST_TEST( cfi == file::config_file_iterator() );
}
//____________________________________________________________________________//
@@ -110,89 +110,89 @@
{
file::config_file_iterator cfi( "test_files/test_broken_line.cfg" );
- BOOST_CHECK( cfi != file::config_file_iterator() );
- BOOST_CHECK_EQUAL( *cfi, "qwerty" ); ++cfi;
- BOOST_CHECK_EQUAL( *cfi, "123 \\11" ); ++cfi;
- BOOST_CHECK_EQUAL( *cfi, " 23" ); ++cfi;
- BOOST_CHECK_EQUAL( *cfi, "xcv \\ dfgsd" ); ++cfi;
- BOOST_CHECK_EQUAL( *cfi, "qwe" ); ++cfi;
- BOOST_CHECK( cfi != file::config_file_iterator() );
- BOOST_CHECK_EQUAL( *cfi, "1 \t23" ); ++cfi;
- BOOST_CHECK_EQUAL( *cfi, "34 34" ); ++cfi;
- BOOST_CHECK_EQUAL( *cfi, "a b c d e f" ); ++cfi;
- BOOST_CHECK_EQUAL( *cfi, "as sa" ); ++cfi;
- BOOST_CHECK_EQUAL( *cfi, "aswe" ); ++cfi;
- BOOST_CHECK( cfi == file::config_file_iterator() );
+ BOOST_TEST( cfi != file::config_file_iterator() );
+ BOOST_TEST( *cfi == "qwerty" ); ++cfi;
+ BOOST_TEST( *cfi == "123 \\11" ); ++cfi;
+ BOOST_TEST( *cfi == " 23" ); ++cfi;
+ BOOST_TEST( *cfi == "xcv \\ dfgsd" ); ++cfi;
+ BOOST_TEST( *cfi == "qwe" ); ++cfi;
+ BOOST_TEST( cfi != file::config_file_iterator() );
+ BOOST_TEST( *cfi == "1 \t23" ); ++cfi;
+ BOOST_TEST( *cfi == "34 34" ); ++cfi;
+ BOOST_TEST( *cfi == "a b c d e f" ); ++cfi;
+ BOOST_TEST( *cfi == "as sa" ); ++cfi;
+ BOOST_TEST( *cfi == "aswe" ); ++cfi;
+ BOOST_TEST( cfi == file::config_file_iterator() );
}
{
file::config_file_iterator cfi( "test_files/test_broken_line.cfg", file::trim_leading_spaces );
- BOOST_CHECK( cfi != file::config_file_iterator() );
- BOOST_CHECK_EQUAL( *cfi, "qwerty" ); ++cfi;
- BOOST_CHECK_EQUAL( *cfi, "123 \\11" ); ++cfi;
- BOOST_CHECK_EQUAL( *cfi, "23" ); ++cfi;
- BOOST_CHECK_EQUAL( *cfi, "xcv \\ dfgsd" ); ++cfi;
- BOOST_CHECK_EQUAL( *cfi, "qwe" ); ++cfi;
- BOOST_CHECK( cfi != file::config_file_iterator() );
- BOOST_CHECK_EQUAL( *cfi, "1 \t23" ); ++cfi;
- BOOST_CHECK_EQUAL( *cfi, "34 34" ); ++cfi;
- BOOST_CHECK_EQUAL( *cfi, "a b c d e f" ); ++cfi;
- BOOST_CHECK_EQUAL( *cfi, "as sa" ); ++cfi;
- BOOST_CHECK_EQUAL( *cfi, "aswe" ); ++cfi;
- BOOST_CHECK( cfi == file::config_file_iterator() );
+ BOOST_TEST( cfi != file::config_file_iterator() );
+ BOOST_TEST( *cfi == "qwerty" ); ++cfi;
+ BOOST_TEST( *cfi == "123 \\11" ); ++cfi;
+ BOOST_TEST( *cfi == "23" ); ++cfi;
+ BOOST_TEST( *cfi == "xcv \\ dfgsd" ); ++cfi;
+ BOOST_TEST( *cfi == "qwe" ); ++cfi;
+ BOOST_TEST( cfi != file::config_file_iterator() );
+ BOOST_TEST( *cfi == "1 \t23" ); ++cfi;
+ BOOST_TEST( *cfi == "34 34" ); ++cfi;
+ BOOST_TEST( *cfi == "a b c d e f" ); ++cfi;
+ BOOST_TEST( *cfi == "as sa" ); ++cfi;
+ BOOST_TEST( *cfi == "aswe" ); ++cfi;
+ BOOST_TEST( cfi == file::config_file_iterator() );
}
{
file::config_file_iterator cfi( "test_files/test_broken_line.cfg", (!file::trim_leading_spaces,!file::trim_trailing_spaces));
- BOOST_CHECK( cfi != file::config_file_iterator() );
- BOOST_CHECK_EQUAL( *cfi, "qwerty" ); ++cfi;
- BOOST_CHECK_EQUAL( *cfi, "123 \\11" ); ++cfi;
- BOOST_CHECK_EQUAL( *cfi, " 23" ); ++cfi;
- BOOST_CHECK_EQUAL( *cfi, "xcv \\ dfgsd" ); ++cfi;
- BOOST_CHECK_EQUAL( *cfi, "qwe" ); ++cfi;
- BOOST_CHECK( cfi != file::config_file_iterator() );
- BOOST_CHECK_EQUAL( *cfi, "1 " ); ++cfi;
- BOOST_CHECK_EQUAL( *cfi, "\t23" ); ++cfi;
- BOOST_CHECK_EQUAL( *cfi, "34 \\ " ); ++cfi;
- BOOST_CHECK_EQUAL( *cfi, "34" ); ++cfi;
- BOOST_CHECK_EQUAL( *cfi, "a b c d e f " ); ++cfi;
- BOOST_CHECK_EQUAL( *cfi, "as \\ " ); ++cfi;
- BOOST_CHECK_EQUAL( *cfi, "sa" ); ++cfi;
- BOOST_CHECK_EQUAL( *cfi, "aswe" ); ++cfi;
- BOOST_CHECK( cfi == file::config_file_iterator() );
+ BOOST_TEST( cfi != file::config_file_iterator() );
+ BOOST_TEST( *cfi == "qwerty" ); ++cfi;
+ BOOST_TEST( *cfi == "123 \\11" ); ++cfi;
+ BOOST_TEST( *cfi == " 23" ); ++cfi;
+ BOOST_TEST( *cfi == "xcv \\ dfgsd" ); ++cfi;
+ BOOST_TEST( *cfi == "qwe" ); ++cfi;
+ BOOST_TEST( cfi != file::config_file_iterator() );
+ BOOST_TEST( *cfi == "1 " ); ++cfi;
+ BOOST_TEST( *cfi == "\t23" ); ++cfi;
+ BOOST_TEST( *cfi == "34 \\ " ); ++cfi;
+ BOOST_TEST( *cfi == "34" ); ++cfi;
+ BOOST_TEST( *cfi == "a b c d e f " ); ++cfi;
+ BOOST_TEST( *cfi == "as \\ " ); ++cfi;
+ BOOST_TEST( *cfi == "sa" ); ++cfi;
+ BOOST_TEST( *cfi == "aswe" ); ++cfi;
+ BOOST_TEST( cfi == file::config_file_iterator() );
}
{
file::config_file_iterator cfi( "test_files/test_broken_line.cfg", !file::skip_empty_lines );
- BOOST_CHECK( cfi != file::config_file_iterator() );
- BOOST_CHECK_EQUAL( *cfi, "qwerty" ); ++cfi;
- BOOST_CHECK_EQUAL( *cfi, "" ); ++cfi;
- BOOST_CHECK_EQUAL( *cfi, "123 \\11" ); ++cfi;
- BOOST_CHECK_EQUAL( *cfi, "" ); ++cfi;
- BOOST_CHECK_EQUAL( *cfi, "" ); ++cfi;
- BOOST_CHECK_EQUAL( *cfi, " 23" ); ++cfi;
- BOOST_CHECK_EQUAL( *cfi, "" ); ++cfi;
- BOOST_CHECK_EQUAL( *cfi, "xcv \\ dfgsd" ); ++cfi;
- BOOST_CHECK_EQUAL( *cfi, "qwe" ); ++cfi;
- BOOST_CHECK( cfi != file::config_file_iterator() );
- BOOST_CHECK_EQUAL( *cfi, "" ); ++cfi;
- BOOST_CHECK_EQUAL( *cfi, "1 " ); ++cfi;
- BOOST_CHECK_EQUAL( *cfi, "\t23" ); ++cfi;
- BOOST_CHECK_EQUAL( *cfi, "" ); ++cfi;
- BOOST_CHECK_EQUAL( *cfi, "34 34" ); ++cfi;
- BOOST_CHECK_EQUAL( *cfi, "" ); ++cfi;
- BOOST_CHECK_EQUAL( *cfi, "a b c d e f" ); ++cfi;
- BOOST_CHECK_EQUAL( *cfi, "" ); ++cfi;
- BOOST_CHECK_EQUAL( *cfi, "as " ); ++cfi;
- BOOST_CHECK_EQUAL( *cfi, "sa" ); ++cfi;
- BOOST_CHECK_EQUAL( *cfi, "" ); ++cfi;
- BOOST_CHECK_EQUAL( *cfi, "as" ); ++cfi;
- BOOST_CHECK_EQUAL( *cfi, "we" ); ++cfi;
- BOOST_CHECK_EQUAL( *cfi, "" ); ++cfi;
- BOOST_CHECK( cfi == file::config_file_iterator() );
+ BOOST_TEST( cfi != file::config_file_iterator() );
+ BOOST_TEST( *cfi == "qwerty" ); ++cfi;
+ BOOST_TEST( *cfi == "" ); ++cfi;
+ BOOST_TEST( *cfi == "123 \\11" ); ++cfi;
+ BOOST_TEST( *cfi == "" ); ++cfi;
+ BOOST_TEST( *cfi == "" ); ++cfi;
+ BOOST_TEST( *cfi == " 23" ); ++cfi;
+ BOOST_TEST( *cfi == "" ); ++cfi;
+ BOOST_TEST( *cfi == "xcv \\ dfgsd" ); ++cfi;
+ BOOST_TEST( *cfi == "qwe" ); ++cfi;
+ BOOST_TEST( cfi != file::config_file_iterator() );
+ BOOST_TEST( *cfi == "" ); ++cfi;
+ BOOST_TEST( *cfi == "1 " ); ++cfi;
+ BOOST_TEST( *cfi == "\t23" ); ++cfi;
+ BOOST_TEST( *cfi == "" ); ++cfi;
+ BOOST_TEST( *cfi == "34 34" ); ++cfi;
+ BOOST_TEST( *cfi == "" ); ++cfi;
+ BOOST_TEST( *cfi == "a b c d e f" ); ++cfi;
+ BOOST_TEST( *cfi == "" ); ++cfi;
+ BOOST_TEST( *cfi == "as " ); ++cfi;
+ BOOST_TEST( *cfi == "sa" ); ++cfi;
+ BOOST_TEST( *cfi == "" ); ++cfi;
+ BOOST_TEST( *cfi == "as" ); ++cfi;
+ BOOST_TEST( *cfi == "we" ); ++cfi;
+ BOOST_TEST( *cfi == "" ); ++cfi;
+ BOOST_TEST( cfi == file::config_file_iterator() );
}
}
@@ -202,30 +202,30 @@
{
{
file::config_file_iterator cfi( "test_files/test_include1.cfg" );
- BOOST_CHECK( cfi != file::config_file_iterator() );
- BOOST_CHECK_EQUAL( *cfi, "a" ); ++cfi;
- BOOST_CHECK_EQUAL( *cfi, "c" ); ++cfi;
- BOOST_CHECK_EQUAL( *cfi, "b" ); ++cfi;
- BOOST_CHECK( cfi == file::config_file_iterator() );
+ BOOST_TEST( cfi != file::config_file_iterator() );
+ BOOST_TEST( *cfi == "a" ); ++cfi;
+ BOOST_TEST( *cfi == "c" ); ++cfi;
+ BOOST_TEST( *cfi == "b" ); ++cfi;
+ BOOST_TEST( cfi == file::config_file_iterator() );
}
{
file::config_file_iterator cfi( "test_files/test_include2.cfg" );
- BOOST_CHECK( cfi != file::config_file_iterator() );
- BOOST_CHECK_EQUAL( *cfi, "1" ); ++cfi;
- BOOST_CHECK_EQUAL( *cfi, "a" ); ++cfi;
- BOOST_CHECK_EQUAL( *cfi, "c" ); ++cfi;
- BOOST_CHECK_EQUAL( *cfi, "b" ); ++cfi;
- BOOST_CHECK_EQUAL( *cfi, "2" ); ++cfi;
- BOOST_CHECK( cfi == file::config_file_iterator() );
+ BOOST_TEST( cfi != file::config_file_iterator() );
+ BOOST_TEST( *cfi == "1" ); ++cfi;
+ BOOST_TEST( *cfi == "a" ); ++cfi;
+ BOOST_TEST( *cfi == "c" ); ++cfi;
+ BOOST_TEST( *cfi == "b" ); ++cfi;
+ BOOST_TEST( *cfi == "2" ); ++cfi;
+ BOOST_TEST( cfi == file::config_file_iterator() );
}
{
file::config_file_iterator cfi( "test_files/test_include3.cfg" );
- BOOST_CHECK( cfi != file::config_file_iterator() );
- BOOST_CHECK_EQUAL( *cfi, "c" ); ++cfi;
- BOOST_CHECK_EQUAL( *cfi, "c" ); ++cfi;
- BOOST_CHECK( cfi == file::config_file_iterator() );
+ BOOST_TEST( cfi != file::config_file_iterator() );
+ BOOST_TEST( *cfi == "c" ); ++cfi;
+ BOOST_TEST( *cfi == "c" ); ++cfi;
+ BOOST_TEST( cfi == file::config_file_iterator() );
}
}
@@ -235,15 +235,13 @@
BOOST_AUTO_TEST_CASE( test_define )
{
- {
- file::config_file_iterator cfi( "test_files/test_define.cfg" );
- BOOST_CHECK( cfi != file::config_file_iterator() );
- BOOST_CHECK_EQUAL( *cfi, "a123123" ); ++cfi;
- BOOST_CHECK_EQUAL( *cfi, "11232" ); ++cfi;
- BOOST_CHECK_EQUAL( *cfi, "a test_value=11" ); ++cfi;
- BOOST_CHECK_EQUAL( *cfi, "1abc2" ); ++cfi;
- BOOST_CHECK( cfi == file::config_file_iterator() );
- }
+ file::config_file_iterator cfi( "test_files/test_define.cfg" );
+ BOOST_TEST( cfi != file::config_file_iterator() );
+ BOOST_TEST( *cfi == "a123123" ); ++cfi;
+ BOOST_TEST( *cfi == "11232" ); ++cfi;
+ BOOST_TEST( *cfi == "a test_value=11" ); ++cfi;
+ BOOST_TEST( *cfi == "1abc2" ); ++cfi;
+ BOOST_TEST( cfi == file::config_file_iterator() );
}
//____________________________________________________________________________//
@@ -255,23 +253,23 @@
{
file::config_file_iterator cfi( "test_files/test_macro_subst1.cfg", !file::detect_missing_macro );
- BOOST_CHECK( cfi != file::config_file_iterator() );
- BOOST_CHECK_EQUAL( *cfi, "a" ); ++cfi;
- BOOST_CHECK( cfi == file::config_file_iterator() );
+ BOOST_TEST( cfi != file::config_file_iterator() );
+ BOOST_TEST( *cfi == "a" ); ++cfi;
+ BOOST_TEST( cfi == file::config_file_iterator() );
}
{
file::config_file_iterator cfi( "test_files/test_macro_subst2.cfg" );
- BOOST_CHECK( cfi != file::config_file_iterator() );
- BOOST_CHECK_EQUAL( *cfi, "atest_value" ); ++cfi;
- BOOST_CHECK( cfi == file::config_file_iterator() );
+ BOOST_TEST( cfi != file::config_file_iterator() );
+ BOOST_TEST( *cfi == "atest_value" ); ++cfi;
+ BOOST_TEST( cfi == file::config_file_iterator() );
}
{
file::config_file_iterator cfi( "test_files/test_macro_subst4.cfg" );
- BOOST_CHECK( cfi != file::config_file_iterator() );
- BOOST_CHECK_EQUAL( *cfi, "abb" ); ++cfi;
- BOOST_CHECK( cfi == file::config_file_iterator() );
+ BOOST_TEST( cfi != file::config_file_iterator() );
+ BOOST_TEST( *cfi == "abb" ); ++cfi;
+ BOOST_TEST( cfi == file::config_file_iterator() );
}
}
@@ -281,10 +279,10 @@
{
{
file::config_file_iterator cfi( "test_files/test_undef.cfg", !file::detect_missing_macro );
- BOOST_CHECK( cfi != file::config_file_iterator() );
- BOOST_CHECK_EQUAL( *cfi, "1123" ); ++cfi;
- BOOST_CHECK_EQUAL( *cfi, "1" ); ++cfi;
- BOOST_CHECK( cfi == file::config_file_iterator() );
+ BOOST_TEST( cfi != file::config_file_iterator() );
+ BOOST_TEST( *cfi == "1123" ); ++cfi;
+ BOOST_TEST( *cfi == "1" ); ++cfi;
+ BOOST_TEST( cfi == file::config_file_iterator() );
}
}
@@ -294,13 +292,13 @@
{
{
file::config_file_iterator cfi( "test_files/test_ifdef.cfg" );
- BOOST_CHECK( cfi != file::config_file_iterator() );
- BOOST_CHECK_EQUAL( *cfi, "1" ); ++cfi;
- BOOST_CHECK_EQUAL( *cfi, "2" ); ++cfi;
- BOOST_CHECK_EQUAL( *cfi, "1" ); ++cfi;
- BOOST_CHECK_EQUAL( *cfi, "1abc" ); ++cfi;
- BOOST_CHECK_EQUAL( *cfi, "a" ); ++cfi;
- BOOST_CHECK( cfi == file::config_file_iterator() );
+ BOOST_TEST( cfi != file::config_file_iterator() );
+ BOOST_TEST( *cfi == "1" ); ++cfi;
+ BOOST_TEST( *cfi == "2" ); ++cfi;
+ BOOST_TEST( *cfi == "1" ); ++cfi;
+ BOOST_TEST( *cfi == "1abc" ); ++cfi;
+ BOOST_TEST( *cfi == "a" ); ++cfi;
+ BOOST_TEST( cfi == file::config_file_iterator() );
}
BOOST_CHECK_THROW( file::config_file_iterator( "test_files/test_ifdef1.cfg" ), rt::logic_error );
Modified: trunk/libs/test/test/config_file_test.cpp
==============================================================================
--- trunk/libs/test/test/config_file_test.cpp (original)
+++ trunk/libs/test/test/config_file_test.cpp 2013-02-04 03:34:26 EST (Mon, 04 Feb 2013)
@@ -30,16 +30,16 @@
{
rtf::config_file cf( "test_files/cfg_file_tst1.cfg" );
- BOOST_CHECK_EQUAL( rtf::get_requ_param_value( cf, "par1" ), "ABC " );
+ BOOST_TEST( rtf::get_requ_param_value( cf, "par1" ) == "ABC " );
- BOOST_CHECK_EQUAL( rtf::get_requ_param_value( cf, "NS1", "par1" ), "12" );
- BOOST_CHECK_EQUAL( rtf::get_requ_param_value( cf, "NS2", "NS3", "par1" ), "OFF" );
- BOOST_CHECK_EQUAL( rtf::get_requ_param_value( cf, "NS2", "NS4", "par1" ), "ON" );
- BOOST_CHECK_EQUAL( rtf::get_requ_param_value( cf, "NS2", "NS4", "NS5", "par1" ), "1 2 3" );
-
- BOOST_CHECK( !rtf::get_param_value( cf, "par1 " ) );
- BOOST_CHECK( !rtf::get_param_value( cf, "par2" ) );
- BOOST_CHECK( !rtf::get_param_value( cf, "NS2", "par1" ) );
+ BOOST_TEST( rtf::get_requ_param_value( cf, "NS1", "par1" ) == "12" );
+ BOOST_TEST( rtf::get_requ_param_value( cf, "NS2", "NS3", "par1" ) == "OFF" );
+ BOOST_TEST( rtf::get_requ_param_value( cf, "NS2", "NS4", "par1" ) == "ON" );
+ BOOST_TEST( rtf::get_requ_param_value( cf, "NS2", "NS4", "NS5", "par1" ) == "1 2 3" );
+
+ BOOST_TEST( !rtf::get_param_value( cf, "par1 " ) );
+ BOOST_TEST( !rtf::get_param_value( cf, "par2" ) );
+ BOOST_TEST( !rtf::get_param_value( cf, "NS2", "par1" ) );
BOOST_CHECK_THROW( rtf::get_requ_param_value( cf, "par1 " ), rt::logic_error );
BOOST_CHECK_THROW( rtf::get_requ_param_value( cf, "par2" ), rt::logic_error );
@@ -55,8 +55,8 @@
cf.load( "test_files/cfg_file_tst3.cfg" );
cf.load( "test_files/cfg_file_tst4.cfg" );
- BOOST_CHECK_EQUAL( rtf::get_requ_param_value( cf, "par1" ), "1" );
- BOOST_CHECK_EQUAL( rtf::get_requ_param_value( cf, "NS", "par2" ), "1 2" );
+ BOOST_TEST( rtf::get_requ_param_value( cf, "par1" ) == "1" );
+ BOOST_TEST( rtf::get_requ_param_value( cf, "NS", "par2" ) == "1 2" );
}
//____________________________________________________________________________//
@@ -67,7 +67,7 @@
cf.load( "test_files/cfg_file_tst2.cfg", rtf::value_marker = "|" );
- BOOST_CHECK_EQUAL( rtf::get_requ_param_value( cf, "par1" ), "\"Simple text \"" );
+ BOOST_TEST( rtf::get_requ_param_value( cf, "par1" ) == "\"Simple text \"" );
}
//____________________________________________________________________________//
@@ -79,8 +79,8 @@
cf.load( "test_files/cfg_file_tst5.cfg", rtf::value_delimeter = "=> " );
cf.load( "test_files/cfg_file_tst6.cfg", rtf::value_delimeter = " " );
- BOOST_CHECK_EQUAL( rtf::get_requ_param_value( cf, "par1" ), "1" );
- BOOST_CHECK_EQUAL( rtf::get_requ_param_value( cf, "NS", "par2" ), "2" );
+ BOOST_TEST( rtf::get_requ_param_value( cf, "par1" ) == "1" );
+ BOOST_TEST( rtf::get_requ_param_value( cf, "NS", "par2" ) == "2" );
}
//____________________________________________________________________________//
@@ -91,7 +91,7 @@
cf.load( "test_files/cfg_file_tst7.cfg", (rtf::namespace_delimeter = "/",rtf::value_delimeter = " ") );
- BOOST_CHECK_EQUAL( rtf::get_requ_param_value( cf, "NS1", "NS2", "par" ), "1" );
+ BOOST_TEST( rtf::get_requ_param_value( cf, "NS1", "NS2", "par" ) == "1" );
}
//____________________________________________________________________________//
@@ -103,10 +103,10 @@
global_param_namespace.clear();
config_file_iterator cfi1( "test_files/par_hdl_tst1.cfg" );
- BOOST_CHECK( global_param_namespace.load_parameters( cfi1 ) );
+ BOOST_TEST( global_param_namespace.load_parameters( cfi1 ) );
config_file_iterator cfi2( "test_files/par_alias1.cfg" );
- BOOST_CHECK( global_param_namespace.load_aliases( cfi2 ) );
+ BOOST_TEST( global_param_namespace.load_aliases( cfi2 ) );
BOOST_CHECK_EQUAL( rtf::get_param_value( "par1" ), "ABC" );
BOOST_CHECK_EQUAL( rtf::get_param_value( "par2" ), "12" );
@@ -126,13 +126,13 @@
BOOST_CHECK_THROW( global_param_namespace.insert_namespace( "ns-1" ), fnd_runtime_exception );
config_file_iterator cfi1( "test_files/par_hdl_tst2.cfg" );
- BOOST_CHECK( !global_param_namespace.load_parameters( cfi1 ) );
+ BOOST_TEST( !global_param_namespace.load_parameters( cfi1 ) );
config_file_iterator cfi2( "test_files/par_alias2.cfg" );
- BOOST_CHECK( !global_param_namespace.load_aliases( cfi2 ) );
+ BOOST_TEST( !global_param_namespace.load_aliases( cfi2 ) );
config_file_iterator cfi3( "test_files/par_alias3.cfg" );
- BOOST_CHECK( !global_param_namespace.load_aliases( cfi3 ) );
+ BOOST_TEST( !global_param_namespace.load_aliases( cfi3 ) );
}
//____________________________________________________________________________//
@@ -143,16 +143,16 @@
global_param_namespace.clear();
config_file_iterator cfi1( "test_files/par_hdl_tst1.cfg" );
- BOOST_CHECK( global_param_namespace.load_parameters( cfi1 ) );
+ BOOST_TEST( global_param_namespace.load_parameters( cfi1 ) );
config_file_iterator cfi2( "test_files/par_alias1.cfg" );
- BOOST_CHECK( global_param_namespace.load_aliases( cfi2 ) );
+ BOOST_TEST( global_param_namespace.load_aliases( cfi2 ) );
output_test_stream ots;
ots << global_param_namespace;
- BOOST_CHECK( ots.is_equal(
+ BOOST_TEST( ots.is_equal(
"par1 " QUOTE_N_END( "ABC" )
"par2 " QUOTE_N_END( "12" )
"par3 " QUOTE_N_END( "OFF" )
@@ -173,80 +173,80 @@
{
{
param_namespace pn( "", NULL );
- BOOST_CHECK( !pn.load_parameters( "test_files/test_multipart_value1.cfg" ) );
+ BOOST_TEST( !pn.load_parameters( "test_files/test_multipart_value1.cfg" ) );
}
{
param_namespace pn( "", NULL );
- BOOST_CHECK( pn.load_parameters( "test_files/test_multipart_value2.cfg" ) );
+ BOOST_TEST( pn.load_parameters( "test_files/test_multipart_value2.cfg" ) );
- BOOST_CHECK_EQUAL( rtf::get_param_value( "a", pn ), "" );
+ BOOST_TEST( rtf::get_param_value( "a", pn ) == "" );
}
{
param_namespace pn( "", NULL );
- BOOST_CHECK( !pn.load_parameters( "test_files/test_multipart_value3.cfg" ) );
+ BOOST_TEST( !pn.load_parameters( "test_files/test_multipart_value3.cfg" ) );
}
{
param_namespace pn( "", NULL );
- BOOST_CHECK( pn.load_parameters( "test_files/test_multipart_value4.cfg" ) );
+ BOOST_TEST( pn.load_parameters( "test_files/test_multipart_value4.cfg" ) );
- BOOST_CHECK_EQUAL( rtf::get_param_value( "a", pn ), "\"" );
+ BOOST_TEST( rtf::get_param_value( "a", pn ) == "\"" );
}
{
param_namespace pn( "", NULL );
- BOOST_CHECK( !pn.load_parameters( "test_files/test_multipart_value5.cfg" ) );
+ BOOST_TEST( !pn.load_parameters( "test_files/test_multipart_value5.cfg" ) );
}
{
param_namespace pn( "", NULL );
- BOOST_CHECK( !pn.load_parameters( "test_files/test_multipart_value6.cfg" ) );
+ BOOST_TEST( !pn.load_parameters( "test_files/test_multipart_value6.cfg" ) );
}
{
param_namespace pn( "", NULL );
- BOOST_CHECK( !pn.load_parameters( "test_files/test_multipart_value7.cfg" ) );
+ BOOST_TEST( !pn.load_parameters( "test_files/test_multipart_value7.cfg" ) );
}
{
param_namespace pn( "", NULL );
- BOOST_CHECK( pn.load_parameters( "test_files/test_multipart_value8.cfg" ) );
+ BOOST_TEST( pn.load_parameters( "test_files/test_multipart_value8.cfg" ) );
- BOOST_CHECK_EQUAL( rtf::get_param_value( "a", pn ), "abcdef" );
+ BOOST_TEST( rtf::get_param_value( "a", pn ) == "abcdef" );
}
{
param_namespace pn( "", NULL );
- BOOST_CHECK( pn.load_parameters( "test_files/test_multipart_value9.cfg" ) );
+ BOOST_TEST( pn.load_parameters( "test_files/test_multipart_value9.cfg" ) );
- BOOST_CHECK_EQUAL( rtf::get_param_value( "a", pn ), "abcdef123" );
+ BOOST_TEST( rtf::get_param_value( "a", pn ) == "abcdef123" );
}
{
param_namespace pn( "", NULL );
- BOOST_CHECK( !pn.load_parameters( "test_files/test_multipart_value10.cfg" ) );
+ BOOST_TEST( !pn.load_parameters( "test_files/test_multipart_value10.cfg" ) );
}
{
param_namespace pn( "", NULL );
- BOOST_CHECK( !pn.load_parameters( "test_files/test_multipart_value11.cfg" ) );
+ BOOST_TEST( !pn.load_parameters( "test_files/test_multipart_value11.cfg" ) );
}
{
param_namespace pn( "", NULL );
- BOOST_CHECK( !pn.load_parameters( "test_files/test_multipart_value12.cfg" ) );
+ BOOST_TEST( !pn.load_parameters( "test_files/test_multipart_value12.cfg" ) );
}
{
param_namespace pn( "", NULL );
- BOOST_CHECK( pn.load_parameters( "test_files/test_multipart_value13.cfg" ) );
+ BOOST_TEST( pn.load_parameters( "test_files/test_multipart_value13.cfg" ) );
const_string pattern( "\"abc\"" );
- BOOST_CHECK_EQUAL( rtf::get_param_value( "a", pn ), pattern );
+ BOOST_TEST( rtf::get_param_value( "a", pn ) == pattern );
}
}
Modified: trunk/libs/test/test/fixed_mapping_test.cpp
==============================================================================
--- trunk/libs/test/test/fixed_mapping_test.cpp (original)
+++ trunk/libs/test/test/fixed_mapping_test.cpp 2013-02-04 03:34:26 EST (Mon, 04 Feb 2013)
@@ -41,15 +41,15 @@
0
);
- BOOST_CHECK_EQUAL( test_mapping[ "Key1" ], 1 );
- BOOST_CHECK_EQUAL( test_mapping[ "Key2" ], 2 );
- BOOST_CHECK_EQUAL( test_mapping[ "QWE" ] , 3 );
- BOOST_CHECK_EQUAL( test_mapping[ "ASD" ] , 4 );
- BOOST_CHECK_EQUAL( test_mapping[ "aws" ] , 5 );
- BOOST_CHECK_EQUAL( test_mapping[ "dfg" ] , 6 );
- BOOST_CHECK_EQUAL( test_mapping[ "dgt" ] , 7 );
- BOOST_CHECK_EQUAL( test_mapping[ "ght" ] , 8 );
- BOOST_CHECK_EQUAL( test_mapping[ "bla" ] , 0 );
+ BOOST_TEST( test_mapping[ "Key1" ] == 1 );
+ BOOST_TEST( test_mapping[ "Key2" ] == 2 );
+ BOOST_TEST( test_mapping[ "QWE" ] == 3 );
+ BOOST_TEST( test_mapping[ "ASD" ] == 4 );
+ BOOST_TEST( test_mapping[ "aws" ] == 5 );
+ BOOST_TEST( test_mapping[ "dfg" ] == 6 );
+ BOOST_TEST( test_mapping[ "dgt" ] == 7 );
+ BOOST_TEST( test_mapping[ "ght" ] == 8 );
+ BOOST_TEST( test_mapping[ "bla" ] == 0 );
}
//____________________________________________________________________________//
@@ -65,15 +65,15 @@
0
);
- BOOST_CHECK_EQUAL( test_mapping[ "Key1" ], 1 );
- BOOST_CHECK_EQUAL( test_mapping[ "Key2" ], 2 );
- BOOST_CHECK_EQUAL( test_mapping[ "QWE" ] , 3 );
- BOOST_CHECK_EQUAL( test_mapping[ "ASD" ] , 4 );
- BOOST_CHECK_EQUAL( test_mapping[ "kEy1" ], 1 );
- BOOST_CHECK_EQUAL( test_mapping[ "key2" ], 2 );
- BOOST_CHECK_EQUAL( test_mapping[ "qwE" ] , 3 );
- BOOST_CHECK_EQUAL( test_mapping[ "aSd" ] , 4 );
- BOOST_CHECK_EQUAL( test_mapping[ "bla" ] , 0 );
+ BOOST_TEST( test_mapping[ "Key1" ] == 1 );
+ BOOST_TEST( test_mapping[ "Key2" ] == 2 );
+ BOOST_TEST( test_mapping[ "QWE" ] == 3 );
+ BOOST_TEST( test_mapping[ "ASD" ] == 4 );
+ BOOST_TEST( test_mapping[ "kEy1" ] == 1 );
+ BOOST_TEST( test_mapping[ "key2" ] == 2 );
+ BOOST_TEST( test_mapping[ "qwE" ] == 3 );
+ BOOST_TEST( test_mapping[ "aSd" ] == 4 );
+ BOOST_TEST( test_mapping[ "bla" ] == 0 );
}
//____________________________________________________________________________//
Modified: trunk/libs/test/test/ifstream_line_iterator_test.cpp
==============================================================================
--- trunk/libs/test/test/ifstream_line_iterator_test.cpp (original)
+++ trunk/libs/test/test/ifstream_line_iterator_test.cpp 2013-02-04 03:34:26 EST (Mon, 04 Feb 2013)
@@ -32,16 +32,16 @@
BOOST_CHECK( it != eoi );
- BOOST_CHECK_EQUAL( *it, "acv ffg" );
+ BOOST_TEST( *it == "acv ffg" );
++it;
- BOOST_CHECK_EQUAL( *it, "" );
+ BOOST_TEST( *it == "" );
++it;
- BOOST_CHECK_EQUAL( *it, " " );
+ BOOST_TEST( *it == " " );
++it;
- BOOST_CHECK_EQUAL( *it, "1" );
+ BOOST_TEST( *it == "1" );
++it;
BOOST_CHECK( it == eoi );
@@ -57,13 +57,13 @@
BOOST_CHECK( it != eoi );
- BOOST_CHECK_EQUAL( *it, "{ abc d " );
+ BOOST_TEST( *it == "{ abc d " );
++it;
- BOOST_CHECK_EQUAL( *it, "\n{ d \n dsfg\n" );
+ BOOST_TEST( *it == "\n{ d \n dsfg\n" );
++it;
- BOOST_CHECK_EQUAL( *it, "\n" );
+ BOOST_TEST( *it == "\n" );
++it;
BOOST_CHECK( it == eoi );
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 2013-02-04 03:34:26 EST (Mon, 04 Feb 2013)
@@ -27,38 +27,38 @@
{
{
output_test_stream output;
- BOOST_CHECK( !output.match_pattern() );
- BOOST_CHECK( output.is_empty() );
+ BOOST_TEST( !output.match_pattern() );
+ BOOST_TEST( output.is_empty() );
}
{
output_test_stream output( (char const*)0 );
- BOOST_CHECK( !output.match_pattern() );
- BOOST_CHECK( output.is_empty() );
+ BOOST_TEST( !output.match_pattern() );
+ BOOST_TEST( output.is_empty() );
}
{
output_test_stream output( "" );
- BOOST_CHECK( !output.match_pattern() );
- BOOST_CHECK( output.is_empty() );
+ BOOST_TEST( !output.match_pattern() );
+ BOOST_TEST( output.is_empty() );
}
{
output_test_stream output( "%&^$%&$%" );
- BOOST_CHECK( !output.match_pattern() );
- BOOST_CHECK( output.is_empty() );
+ BOOST_TEST( !output.match_pattern() );
+ BOOST_TEST( output.is_empty() );
}
{
output_test_stream output( "pattern.temp" );
- BOOST_CHECK( !output.match_pattern() );
- BOOST_CHECK( output.is_empty() );
+ BOOST_TEST( !output.match_pattern() );
+ BOOST_TEST( output.is_empty() );
}
{
output_test_stream output( "pattern.temp2", false );
- BOOST_CHECK( output.match_pattern() );
- BOOST_CHECK( output.is_empty() );
+ BOOST_TEST( output.match_pattern() );
+ BOOST_TEST( output.is_empty() );
}
{
output_test_stream output( "pattern.temp2" );
- BOOST_CHECK( output.match_pattern() );
- BOOST_CHECK( output.is_empty() );
+ BOOST_TEST( output.match_pattern() );
+ BOOST_TEST( output.is_empty() );
}
}
@@ -67,18 +67,18 @@
BOOST_AUTO_TEST_CASE( test_is_empty )
{
output_test_stream output;
- BOOST_CHECK( output.is_empty() );
+ BOOST_TEST( output.is_empty() );
output << 12345;
- BOOST_CHECK( !output.is_empty() );
- BOOST_CHECK( output.is_empty() );
+ BOOST_TEST( !output.is_empty() );
+ BOOST_TEST( output.is_empty() );
output << "";
- BOOST_CHECK( output.is_empty() );
+ BOOST_TEST( output.is_empty() );
output << '\0';
- BOOST_CHECK( !output.is_empty( false ) );
- BOOST_CHECK( !output.is_empty() );
+ BOOST_TEST( !output.is_empty( false ) );
+ BOOST_TEST( !output.is_empty() );
}
//____________________________________________________________________________//
@@ -86,24 +86,24 @@
BOOST_AUTO_TEST_CASE( test_check_length )
{
output_test_stream output;
- BOOST_CHECK( output.check_length( 0 ) );
+ BOOST_TEST( output.check_length( 0 ) );
output << "";
- BOOST_CHECK( output.check_length( 0 ) );
+ BOOST_TEST( output.check_length( 0 ) );
output << '\0';
- BOOST_CHECK( output.check_length( 1 ) );
+ BOOST_TEST( output.check_length( 1 ) );
output << 1220;
- BOOST_CHECK( output.check_length( 4 ) );
+ BOOST_TEST( output.check_length( 4 ) );
output << "Text message";
- BOOST_CHECK( output.check_length( 12, false ) );
- BOOST_CHECK( output.check_length( 12 ) );
+ BOOST_TEST( output.check_length( 12, false ) );
+ BOOST_TEST( output.check_length( 12 ) );
output.width( 20 );
output << "Text message";
- BOOST_CHECK( output.check_length( 20 ) );
+ BOOST_TEST( output.check_length( 20 ) );
}
//____________________________________________________________________________//
@@ -111,37 +111,37 @@
BOOST_AUTO_TEST_CASE( test_is_equal )
{
output_test_stream output;
- BOOST_CHECK( output.is_equal( "" ) );
+ BOOST_TEST( output.is_equal( "" ) );
output << 1;
- BOOST_CHECK( output.is_equal( "1" ) );
+ BOOST_TEST( output.is_equal( "1" ) );
output << "";
- BOOST_CHECK( output.is_equal( "" ) );
+ BOOST_TEST( output.is_equal( "" ) );
output << '\0';
- BOOST_CHECK( output.is_equal( boost::unit_test::const_string( "", 1 ) ) );
+ BOOST_TEST( output.is_equal( boost::unit_test::const_string( "", 1 ) ) );
output << std::setw( 10 ) << "qwerty" << '\n';
- BOOST_CHECK( output.is_equal( " qwerty\n" ) );
+ BOOST_TEST( output.is_equal( " qwerty\n" ) );
std::string s( "test string" );
output << s << std::endl;
- BOOST_CHECK( output.is_equal( "test string\n", false ) );
+ BOOST_TEST( output.is_equal( "test string\n", false ) );
output << s << std::endl;
- BOOST_CHECK( output.is_equal( "test string\ntest string\n" ) );
+ BOOST_TEST( output.is_equal( "test string\ntest string\n" ) );
char const* literal_string = "asdfghjkl";
std::string substr1( literal_string, 5 );
std::string substr2( literal_string+5, 4 );
output << substr1;
- BOOST_CHECK( output.is_equal( boost::unit_test::const_string( literal_string, 5 ), false ) );
+ BOOST_TEST( output.is_equal( boost::unit_test::const_string( literal_string, 5 ), false ) );
output << substr2;
- BOOST_CHECK( output.is_equal( boost::unit_test::const_string( literal_string, 9 ) ) );
+ BOOST_TEST( output.is_equal( boost::unit_test::const_string( literal_string, 9 ) ) );
}
//____________________________________________________________________________//
@@ -152,39 +152,39 @@
output_test_stream output( "pattern.test", i1 == 1 );
output << "text1\n";
- BOOST_CHECK( output.match_pattern() );
+ BOOST_TEST( output.match_pattern() );
output << "text2\n";
- BOOST_CHECK( output.match_pattern() );
+ BOOST_TEST( output.match_pattern() );
output << "text3\n";
- BOOST_CHECK( output.match_pattern() );
+ BOOST_TEST( output.match_pattern() );
}
{
output_test_stream output( "pattern.test" );
output << "text4\n";
- BOOST_CHECK( !output.match_pattern() );
+ BOOST_TEST( !output.match_pattern() );
output << "text2\n";
- BOOST_CHECK( output.match_pattern() );
+ BOOST_TEST( output.match_pattern() );
output << "text3\n";
- BOOST_CHECK( output.match_pattern() );
+ BOOST_TEST( output.match_pattern() );
}
{
output_test_stream output( "pattern.test" );
output << "text\n";
- BOOST_CHECK( !output.match_pattern() );
+ BOOST_TEST( !output.match_pattern() );
output << "text2\n";
- BOOST_CHECK( !output.match_pattern() );
+ BOOST_TEST( !output.match_pattern() );
output << "text3\n";
- BOOST_CHECK( !output.match_pattern() );
+ BOOST_TEST( !output.match_pattern() );
}
for( int i2 = 0; i2 < 2; i2++ ) {
output_test_stream output( "pattern.test", i2 == 1, false );
output << "text\rmore text\n";
- BOOST_CHECK( output.match_pattern() );
+ BOOST_TEST( output.match_pattern() );
}
}
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 2013-02-04 03:34:26 EST (Mon, 04 Feb 2013)
@@ -70,15 +70,15 @@
results_reporter::confirmation_report( id );
output << "*************************************************************************\n";
- BOOST_CHECK( output.match_pattern() );
+ BOOST_TEST( output.match_pattern() );
results_reporter::short_report( id );
output << "*************************************************************************\n";
- BOOST_CHECK( output.match_pattern() );
+ BOOST_TEST( output.match_pattern() );
results_reporter::detailed_report( id );
output << "*************************************************************************\n";
- BOOST_CHECK( output.match_pattern() );
+ BOOST_TEST( output.match_pattern() );
}
//____________________________________________________________________________//
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 2013-02-04 03:34:26 EST (Mon, 04 Feb 2013)
@@ -46,7 +46,7 @@
utf::test_case_counter tcc;
utf::traverse_test_tree( master_ts->p_id, tcc );
- BOOST_CHECK_EQUAL( tcc.p_count, expected );
+ BOOST_TEST( tcc.p_count == expected );
}
BOOST_AUTO_TEST_CASE( test_run_by_name )
@@ -72,7 +72,7 @@
{
utf::test_case_counter tcc;
utf::traverse_test_tree( master_ts->p_id, tcc );
- BOOST_CHECK_EQUAL( tcc.p_count, 9U );
+ BOOST_TEST( tcc.p_count == 9U );
}
{
Modified: trunk/libs/test/test/sync_access_test.cpp
==============================================================================
--- trunk/libs/test/test/sync_access_test.cpp (original)
+++ trunk/libs/test/test/sync_access_test.cpp 2013-02-04 03:34:26 EST (Mon, 04 Feb 2013)
@@ -32,7 +32,7 @@
{
b.wait(); /// wait until memory barrier allows the execution
boost::mutex::scoped_lock lock(m); /// lock mutex
- BOOST_CHECK_EQUAL(1,0); /// produce the fault
+ BOOST_TEST(1 ==0); /// produce the fault
}
BOOST_AUTO_TEST_CASE_EXPECTED_FAILURES( test_multiple_assertion_faults, 100 )
Modified: trunk/libs/test/test/test_assertion_construction.cpp
==============================================================================
--- trunk/libs/test/test/test_assertion_construction.cpp (original)
+++ trunk/libs/test/test/test_assertion_construction.cpp 2013-02-04 03:34:26 EST (Mon, 04 Feb 2013)
@@ -16,60 +16,67 @@
#define BOOST_TEST_MODULE Boost.Test assertion consruction test
#include <boost/test/unit_test.hpp>
#include <boost/test/tools/assertion.hpp>
+#ifdef BOOST_NO_CXX11_AUTO_DECLARATIONS
+#include <boost/test/tools/detail/expression_holder.hpp>
+#endif
//____________________________________________________________________________//
#ifdef BOOST_NO_CXX11_AUTO_DECLARATIONS
-#define EXPR_TYPE assertion::expression const&
+
+# define EXPR_TYPE( E, expr ) tt_detail::expression_holder const& E = tt_detail::hold_expression(assertion::seed() ->* expr)
+# define BOOST_TEST_FWD( a ) BOOST_CHECK( a )
+
#else
-#define EXPR_TYPE auto const&
+
+# define EXPR_TYPE( E, expr ) auto const& E = assertion::seed() ->* expr
+# define BOOST_TEST_FWD( a ) BOOST_TEST( a )
#endif
BOOST_AUTO_TEST_CASE( test_basic_value_expression_construction )
{
using namespace boost::test_tools;
- assertion::seed seed;
{
- EXPR_TYPE E = assertion::seed()->*1;
+ EXPR_TYPE( E, 1 );
predicate_result const& res = E.evaluate();
- BOOST_CHECK( res );
- BOOST_CHECK( res.message().is_empty() );
+ BOOST_TEST_FWD( res );
+ BOOST_TEST_FWD( res.message().is_empty() );
}
{
- EXPR_TYPE E = seed->*0;
+ EXPR_TYPE( E, 0 );
predicate_result const& res = E.evaluate();
- BOOST_CHECK( !res );
- BOOST_CHECK_EQUAL( res.message(), "(bool)0 is false" );
+ BOOST_TEST_FWD( !res );
+ BOOST_TEST_FWD( res.message() == " [(bool)0 is false]" );
}
{
- EXPR_TYPE E = seed->*true;
+ EXPR_TYPE( E, true );
predicate_result const& res = E.evaluate();
- BOOST_CHECK( res );
- BOOST_CHECK( res.message().is_empty() );
+ BOOST_TEST_FWD( res );
+ BOOST_TEST_FWD( res.message().is_empty() );
}
{
- EXPR_TYPE E = seed->*1.5;
+ EXPR_TYPE( E, 1.5 );
predicate_result const& res = E.evaluate();
- BOOST_CHECK( res );
+ BOOST_TEST_FWD( res );
}
-#ifndef BOOST_NO_CXX11_DECLTYPE
+#ifndef BOOST_NO_DECLTYPE
{
- EXPR_TYPE E = seed->* "abc";
+ EXPR_TYPE( E, "abc" );
predicate_result const& res = E.evaluate();
- BOOST_CHECK( res );
+ BOOST_TEST_FWD( res );
}
#endif
{
- EXPR_TYPE E = seed->* 1>2;
+ EXPR_TYPE( E, 1>2 );
predicate_result const& res = E.evaluate();
- BOOST_CHECK( !res );
- BOOST_CHECK_EQUAL( res.message(), "1 <= 2" );
+ BOOST_TEST_FWD( !res );
+ BOOST_TEST_FWD( res.message() == " [1 <= 2]" );
}
}
@@ -79,115 +86,113 @@
BOOST_AUTO_TEST_CASE( test_comparison_expression )
{
using namespace boost::test_tools;
- assertion::seed seed;
{
- EXPR_TYPE E = seed->* 1>2;
+ EXPR_TYPE( E, 1>2 );
predicate_result const& res = E.evaluate();
- BOOST_CHECK( !res );
- BOOST_CHECK_EQUAL( res.message(), "1 <= 2" );
+ BOOST_TEST_FWD( !res );
+ BOOST_TEST_FWD( res.message() == " [1 <= 2]" );
}
{
- EXPR_TYPE E = seed->* 100 < 50;
+ EXPR_TYPE( E, 100 < 50 );
predicate_result const& res = E.evaluate();
- BOOST_CHECK( !res );
- BOOST_CHECK_EQUAL( res.message(), "100 >= 50" );
+ BOOST_TEST_FWD( !res );
+ BOOST_TEST_FWD( res.message() == " [100 >= 50]" );
}
{
- EXPR_TYPE E = seed->* 5 <= 4;
+ EXPR_TYPE( E, 5 <= 4 );
predicate_result const& res = E.evaluate();
- BOOST_CHECK( !res );
- BOOST_CHECK_EQUAL( res.message(), "5 > 4" );
+ BOOST_TEST_FWD( !res );
+ BOOST_TEST_FWD( res.message() == " [5 > 4]" );
}
{
- EXPR_TYPE E = seed->* 10>=20;
+ EXPR_TYPE( E, 10>=20 );
predicate_result const& res = E.evaluate();
- BOOST_CHECK( !res );
- BOOST_CHECK_EQUAL( res.message(), "10 < 20" );
+ BOOST_TEST_FWD( !res );
+ BOOST_TEST_FWD( res.message() == " [10 < 20]" );
}
{
int i = 10;
- EXPR_TYPE E = seed->* i != 10;
+ EXPR_TYPE( E, i != 10 );
predicate_result const& res = E.evaluate();
- BOOST_CHECK( !res );
- BOOST_CHECK_EQUAL( res.message(), "10 == 10" );
+ BOOST_TEST_FWD( !res );
+ BOOST_TEST_FWD( res.message() == " [10 == 10]" );
}
{
int i = 5;
- EXPR_TYPE E = seed->* i == 3;
+ EXPR_TYPE( E, i == 3 );
predicate_result const& res = E.evaluate();
- BOOST_CHECK( !res );
- BOOST_CHECK_EQUAL( res.message(), "5 != 3" );
+ BOOST_TEST_FWD( !res );
+ BOOST_TEST_FWD( res.message() == " [5 != 3]" );
}
}
//____________________________________________________________________________//
-#ifndef BOOST_NO_CXX11_DECLTYPE
+#ifndef BOOST_NO_DECLTYPE
BOOST_AUTO_TEST_CASE( test_arithmetic_ops )
{
using namespace boost::test_tools;
- assertion::seed seed;
{
int i = 3;
int j = 5;
- EXPR_TYPE E = seed->* i+j !=8;
+ EXPR_TYPE( E, i+j !=8 );
predicate_result const& res = E.evaluate();
- BOOST_CHECK( !res );
- BOOST_CHECK_EQUAL( res.message(), "3 + 5 == 8" );
+ BOOST_TEST_FWD( !res );
+ BOOST_TEST_FWD( res.message() == " [3 + 5 == 8]" );
}
{
int i = 3;
int j = 5;
- EXPR_TYPE E = seed->* 2*i-j > 1;
+ EXPR_TYPE( E, 2*i-j > 1 );
predicate_result const& res = E.evaluate();
- BOOST_CHECK( !res );
- BOOST_CHECK_EQUAL( res.message(), "2 * 3 - 5 <= 1" );
+ BOOST_TEST_FWD( !res );
+ BOOST_TEST_FWD( res.message() == " [2 * 3 - 5 <= 1]" );
}
{
int j = 5;
- EXPR_TYPE E = seed->* 2<<j < 30;
+ EXPR_TYPE( E, 2<<j < 30 );
predicate_result const& res = E.evaluate();
- BOOST_CHECK( !res );
- BOOST_CHECK_EQUAL( res.message(), "2 << 5 >= 30" );
+ BOOST_TEST_FWD( !res );
+ BOOST_TEST_FWD( res.message() == " [2 << 5 >= 30]" );
}
{
int i = 2;
int j = 5;
- EXPR_TYPE E = seed->* i&j;
+ EXPR_TYPE( E, i&j );
predicate_result const& res = E.evaluate();
- BOOST_CHECK( !res );
- BOOST_CHECK_EQUAL( res.message(), "2 & 5" );
+ BOOST_TEST_FWD( !res );
+ BOOST_TEST_FWD( res.message() == " [2 & 5]" );
}
{
int i = 3;
int j = 5;
- EXPR_TYPE E = seed->* i^j^6;
+ EXPR_TYPE( E, i^j^6 );
predicate_result const& res = E.evaluate();
- BOOST_CHECK( !res );
- BOOST_CHECK_EQUAL( res.message(), "3 ^ 5 ^ 6" );
+ BOOST_TEST_FWD( !res );
+ BOOST_TEST_FWD( res.message() == " [3 ^ 5 ^ 6]" );
}
// do not support
- // EXPR_TYPE E = seed->*99/2 == 48 || 101/2 > 50;
- // EXPR_TYPE E = seed->* a ? 100 < 50 : 25*2 == 50;
- // EXPR_TYPE E = seed->* true,false;
+ // EXPR_TYPE( E, 99/2 == 48 || 101/2 > 50 );
+ // EXPR_TYPE( E, a ? 100 < 50 : 25*2 == 50 );
+ // EXPR_TYPE( E, true,false );
}
//____________________________________________________________________________//
-#endif // BOOST_NO_CXX11_DECLTYPE
+#endif // BOOST_NO_DECLTYPE
struct Testee {
static int s_copy_counter;
@@ -221,7 +226,7 @@
public:
NC() {}
- bool operator==(NC const&) { return false; }
+ bool operator==(NC const&) const { return false; }
friend std::ostream& operator<<(std::ostream& ostr, NC const&)
{
return ostr << "NC";
@@ -231,64 +236,53 @@
BOOST_AUTO_TEST_CASE( test_objects )
{
using namespace boost::test_tools;
- assertion::seed seed;
+
+#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && !defined(BOOST_NO_CXX11_AUTO_DECLARATIONS)
+ int expected_copy_count = 0;
+#else
+ int expected_copy_count = 2;
+#endif
{
Testee obj;
Testee::s_copy_counter = 0;
- EXPR_TYPE E = seed->* obj;
+ EXPR_TYPE( E, obj );
predicate_result const& res = E.evaluate();
- BOOST_CHECK( !res );
- BOOST_CHECK_EQUAL( res.message(), "(bool)Testee is false" );
-#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
- BOOST_CHECK_EQUAL( Testee::s_copy_counter, 0 );
-#else
- BOOST_CHECK_EQUAL( Testee::s_copy_counter, 1 );
-#endif
+ BOOST_TEST_FWD( !res );
+ BOOST_TEST_FWD( res.message() == " [(bool)Testee is false]" );
+ BOOST_TEST_FWD( Testee::s_copy_counter == expected_copy_count );
}
{
Testee const obj;
Testee::s_copy_counter = 0;
- EXPR_TYPE E = seed->* obj;
+ EXPR_TYPE( E, obj );
predicate_result const& res = E.evaluate();
- BOOST_CHECK( !res );
- BOOST_CHECK_EQUAL( res.message(), "(bool)Testee is false" );
-#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
- BOOST_CHECK_EQUAL( Testee::s_copy_counter, 0 );
-#else
- BOOST_CHECK_EQUAL( Testee::s_copy_counter, 1 );
-#endif
+ BOOST_TEST_FWD( !res );
+ BOOST_TEST_FWD( res.message() == " [(bool)Testee is false]" );
+ BOOST_TEST_FWD( Testee::s_copy_counter == expected_copy_count );
}
{
Testee::s_copy_counter = 0;
- EXPR_TYPE E = seed->* get_obj();
+ EXPR_TYPE( E, get_obj() );
predicate_result const& res = E.evaluate();
- BOOST_CHECK( !res );
- BOOST_CHECK_EQUAL( res.message(), "(bool)Testee is false" );
-#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
- BOOST_CHECK_EQUAL( Testee::s_copy_counter, 0 );
-#else
- BOOST_CHECK_EQUAL( Testee::s_copy_counter, 1 );
-#endif
+ BOOST_TEST_FWD( !res );
+ BOOST_TEST_FWD( res.message() == " [(bool)Testee is false]" );
+ BOOST_TEST_FWD( Testee::s_copy_counter == expected_copy_count );
}
{
Testee::s_copy_counter = 0;
- EXPR_TYPE E = seed->* get_const_obj();
+ EXPR_TYPE( E, get_const_obj() );
predicate_result const& res = E.evaluate();
- BOOST_CHECK( !res );
- BOOST_CHECK_EQUAL( res.message(), "(bool)Testee is false" );
-#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
- BOOST_CHECK_EQUAL( Testee::s_copy_counter, 0 );
-#else
- BOOST_CHECK_EQUAL( Testee::s_copy_counter, 1 );
-#endif
+ BOOST_TEST_FWD( !res );
+ BOOST_TEST_FWD( res.message() == " [(bool)Testee is false]" );
+ BOOST_TEST_FWD( Testee::s_copy_counter == expected_copy_count );
}
{
@@ -297,24 +291,24 @@
Testee t1;
Testee t2;
- EXPR_TYPE E = seed->* t1 != t2;
+ EXPR_TYPE( E, t1 != t2 );
predicate_result const& res = E.evaluate();
- BOOST_CHECK( !res );
- BOOST_CHECK_EQUAL( res.message(), "Testee == Testee" );
+ BOOST_TEST_FWD( !res );
+ BOOST_TEST_FWD( res.message() == " [Testee == Testee]" );
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
- BOOST_CHECK_EQUAL( Testee::s_copy_counter, 0 );
+ BOOST_TEST_FWD( Testee::s_copy_counter == 0 );
#endif
}
-#ifndef BOOST_NO_CXX11_AUTO_DECLARATIONS
+#if !defined(BOOST_NO_CXX11_AUTO_DECLARATIONS)
{
NC nc1;
NC nc2;
- EXPR_TYPE E = seed->* nc1 == nc2;
+ EXPR_TYPE( E, nc1 == nc2 );
predicate_result const& res = E.evaluate();
- BOOST_CHECK( !res );
- BOOST_CHECK_EQUAL( res.message(), "NC != NC" );
+ BOOST_TEST_FWD( !res );
+ BOOST_TEST_FWD( res.message() == " [NC != NC]" );
}
#endif
}
@@ -324,51 +318,50 @@
BOOST_AUTO_TEST_CASE( test_pointers )
{
using namespace boost::test_tools;
- assertion::seed seed;
{
Testee* ptr = 0;
- EXPR_TYPE E = seed->* ptr;
+ EXPR_TYPE( E, ptr );
predicate_result const& res = E.evaluate();
- BOOST_CHECK( !res );
+ BOOST_TEST_FWD( !res );
}
{
Testee obj1;
Testee obj2;
- EXPR_TYPE E = seed->* &obj1 == &obj2;
+ EXPR_TYPE( E, &obj1 == &obj2 );
predicate_result const& res = E.evaluate();
- BOOST_CHECK( !res );
+ BOOST_TEST_FWD( !res );
}
{
Testee obj;
Testee* ptr =&obj;
- EXPR_TYPE E = seed->* *ptr;
+ EXPR_TYPE( E, *ptr );
predicate_result const& res = E.evaluate();
- BOOST_CHECK( !res );
- BOOST_CHECK_EQUAL( res.message(), "(bool)Testee is false" );
+ BOOST_TEST_FWD( !res );
+ BOOST_TEST_FWD( res.message() == " [(bool)Testee is false]" );
}
-#ifndef BOOST_NO_CXX11_DECLTYPE
+#ifndef BOOST_NO_DECLTYPE
{
Testee obj;
Testee* ptr =&obj;
bool Testee::* mem_ptr =&Testee::m_value;
- EXPR_TYPE E = seed->* ptr->*mem_ptr;
+ EXPR_TYPE( E, ptr->*mem_ptr );
predicate_result const& res = E.evaluate();
- BOOST_CHECK( !res );
+ BOOST_TEST_FWD( !res );
}
#endif
// do not support
// Testee obj;
// bool Testee::* mem_ptr =&Testee::m_value;
- // EXPR_TYPE E = seed->* obj.*mem_ptr;
+ // EXPR_TYPE( E, obj.*mem_ptr );
}
//____________________________________________________________________________//
@@ -376,89 +369,88 @@
BOOST_AUTO_TEST_CASE( test_mutating_ops )
{
using namespace boost::test_tools;
- assertion::seed seed;
{
int j = 5;
- EXPR_TYPE E = seed->* j = 0;
+ EXPR_TYPE( E, j = 0 );
predicate_result const& res = E.evaluate();
- BOOST_CHECK( !res );
- BOOST_CHECK_EQUAL( res.message(), "(bool)0 is false" );
+ BOOST_TEST_FWD( !res );
+ BOOST_TEST_FWD( res.message() == " [(bool)0 is false]" );
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
- BOOST_CHECK_EQUAL( j, 0 );
+ BOOST_TEST_FWD( j == 0 );
#else
- BOOST_CHECK_EQUAL( j, 5 );
+ BOOST_TEST_FWD( j == 5 );
#endif
}
{
int j = 5;
- EXPR_TYPE E = seed->* j -= 5;
+ EXPR_TYPE( E, j -= 5 );
predicate_result const& res = E.evaluate();
- BOOST_CHECK( !res );
- BOOST_CHECK_EQUAL( res.message(), "(bool)0 is false" );
+ BOOST_TEST_FWD( !res );
+ BOOST_TEST_FWD( res.message() == " [(bool)0 is false]" );
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
- BOOST_CHECK_EQUAL( j, 0 );
+ BOOST_TEST_FWD( j == 0 );
#else
- BOOST_CHECK_EQUAL( j, 5 );
+ BOOST_TEST_FWD( j == 5 );
#endif
}
{
int j = 5;
- EXPR_TYPE E = seed->* j *= 0;
+ EXPR_TYPE( E, j *= 0 );
predicate_result const& res = E.evaluate();
- BOOST_CHECK( !res );
- BOOST_CHECK_EQUAL( res.message(), "(bool)0 is false" );
+ BOOST_TEST_FWD( !res );
+ BOOST_TEST_FWD( res.message() == " [(bool)0 is false]" );
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
- BOOST_CHECK_EQUAL( j, 0 );
+ BOOST_TEST_FWD( j == 0 );
#else
- BOOST_CHECK_EQUAL( j, 5 );
+ BOOST_TEST_FWD( j == 5 );
#endif
}
{
int j = 5;
- EXPR_TYPE E = seed->* j /= 10;
+ EXPR_TYPE( E, j /= 10 );
predicate_result const& res = E.evaluate();
- BOOST_CHECK( !res );
- BOOST_CHECK_EQUAL( res.message(), "(bool)0 is false" );
+ BOOST_TEST_FWD( !res );
+ BOOST_TEST_FWD( res.message() == " [(bool)0 is false]" );
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
- BOOST_CHECK_EQUAL( j, 0 );
+ BOOST_TEST_FWD( j == 0 );
#else
- BOOST_CHECK_EQUAL( j, 5 );
+ BOOST_TEST_FWD( j == 5 );
#endif
}
{
int j = 4;
- EXPR_TYPE E = seed->* j %= 2;
+ EXPR_TYPE( E, j %= 2 );
predicate_result const& res = E.evaluate();
- BOOST_CHECK( !res );
- BOOST_CHECK_EQUAL( res.message(), "(bool)0 is false" );
+ BOOST_TEST_FWD( !res );
+ BOOST_TEST_FWD( res.message() == " [(bool)0 is false]" );
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
- BOOST_CHECK_EQUAL( j, 0 );
+ BOOST_TEST_FWD( j == 0 );
#else
- BOOST_CHECK_EQUAL( j, 4 );
+ BOOST_TEST_FWD( j == 4 );
#endif
}
{
int j = 5;
- EXPR_TYPE E = seed->* j ^= j;
+ EXPR_TYPE( E, j ^= j );
predicate_result const& res = E.evaluate();
- BOOST_CHECK( !res );
- BOOST_CHECK_EQUAL( res.message(), "(bool)0 is false" );
+ BOOST_TEST_FWD( !res );
+ BOOST_TEST_FWD( res.message() == " [(bool)0 is false]" );
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
- BOOST_CHECK_EQUAL( j, 0 );
+ BOOST_TEST_FWD( j == 0 );
#else
- BOOST_CHECK_EQUAL( j, 5 );
+ BOOST_TEST_FWD( j == 5 );
#endif
}
}
@@ -470,7 +462,6 @@
BOOST_AUTO_TEST_CASE( collection_comparison )
{
using namespace boost::test_tools;
- assertion::seed seed;
{
std::vector<int> v;
@@ -483,10 +474,10 @@
l.push_back( 3 );
l.push_back( 2 );
- EXPR_TYPE E = seed->* v < l;
+ EXPR_TYPE( E, v < l );
predicate_result const& res = E.evaluate();
- BOOST_CHECK( !res );
- BOOST_CHECK_EQUAL( res.message(), "\nMismatch in a position 0: 1 >= 1\nMismatch in a position 2: 3 >= 2" );
+ BOOST_TEST_FWD( !res );
+ BOOST_TEST_FWD( res.message() == ". \nMismatch in a position 0: 1 >= 1\nMismatch in a position 2: 3 >= 2" );
}
{
@@ -495,10 +486,10 @@
std::list<int> l;
- EXPR_TYPE E = seed->* v == l;
+ EXPR_TYPE( E, v == l );
predicate_result const& res = E.evaluate();
- BOOST_CHECK( !res );
- BOOST_CHECK_EQUAL( res.message(), "Collections size mismatch: 1 != 0");
+ BOOST_TEST_FWD( !res );
+ BOOST_TEST_FWD( res.message() == ". Collections size mismatch: 1 != 0");
}
{
@@ -512,30 +503,30 @@
l.push_back( 3 );
l.push_back( 2 );
- EXPR_TYPE E = seed->* v >= l;
+ EXPR_TYPE( E, v >= l );
predicate_result const& res = E.evaluate();
- BOOST_CHECK( !res );
- BOOST_CHECK_EQUAL( res.message(), "\nMismatch in a position 1: 2 < 3");
+ BOOST_TEST_FWD( !res );
+ BOOST_TEST_FWD( res.message() == ". \nMismatch in a position 1: 2 < 3");
}
{
std::string s1 = "asdfhjk";
std::string s2 = "asdfgjk";
- EXPR_TYPE E = seed->* s1 == s2;
+ EXPR_TYPE( E, s1 == s2 );
predicate_result const& res = E.evaluate();
- BOOST_CHECK( !res );
- BOOST_CHECK_EQUAL( res.message(), "asdfhjk != asdfgjk");
+ BOOST_TEST_FWD( !res );
+ BOOST_TEST_FWD( res.message() == " [asdfhjk != asdfgjk]");
}
{
std::string str1 = "hello world";
std::string str2 = "helko worlt";
- EXPR_TYPE E = seed->* boost::unit_test::const_string( str1 ) == boost::unit_test::const_string( str2 );
+ EXPR_TYPE( E, boost::unit_test::const_string( str1 ) == boost::unit_test::const_string( str2 ) );
predicate_result const& res = E.evaluate();
- BOOST_CHECK( !res );
- BOOST_CHECK_EQUAL( res.message(), "hello world != helko worlt");
+ BOOST_TEST_FWD( !res );
+ BOOST_TEST_FWD( res.message() == " [hello world != helko worlt]");
}
}
@@ -543,5 +534,29 @@
#endif
+#if 0
+struct Callable {
+ int operator()() { return 0; }
+ int operator()( int ) { return 1; }
+ int operator()( int, int ) { return 2; }
+};
+
+BOOST_AUTO_TEST_CASE( test_predicate_invocation )
+{
+ using namespace boost::test_tools;
+
+ {
+ Callable c;
+
+ EXPR_TYPE( E, c );
+ predicate_result const& res = E.evaluate();
+ BOOST_TEST_FWD( !res );
+ BOOST_TEST_FWD( res.message() == " [(bool)0 is false]" );
+ }
+}
+
+//____________________________________________________________________________//
+#endif
+
// 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 2013-02-04 03:34:26 EST (Mon, 04 Feb 2013)
@@ -35,16 +35,16 @@
BOOST_TEST_CASE_TEMPLATE_FUNCTION( test0, Number )
{
- BOOST_CHECK_EQUAL( 2, (int const)Number::value );
+ BOOST_TEST( 2 == (int const)Number::value );
}
//____________________________________________________________________________//
BOOST_TEST_CASE_TEMPLATE_FUNCTION( test1, Number )
{
- BOOST_CHECK_EQUAL( 6, (int const)Number::value );
- BOOST_REQUIRE( 2 <= (int const)Number::value );
- BOOST_CHECK_EQUAL( 3, (int const)Number::value );
+ BOOST_TEST( 6 == (int const)Number::value );
+ BOOST_TEST_REQUIRE( 2 <= (int const)Number::value );
+ BOOST_TEST( 3 == (int const)Number::value );
}
//____________________________________________________________________________//
@@ -69,8 +69,8 @@
ut::test_results const& tr = ut::results_collector.results( test->p_id );
ut::unit_test_log.set_stream( std::cout );
- BOOST_CHECK_EQUAL( tr.p_assertions_failed, (std::size_t)0 );
- BOOST_CHECK( !tr.p_aborted );
+ BOOST_TEST( tr.p_assertions_failed == 0U );
+ BOOST_TEST( !tr.p_aborted );
}
//____________________________________________________________________________//
@@ -89,8 +89,8 @@
ut::test_results const& tr = ut::results_collector.results( test->p_id );
ut::unit_test_log.set_stream( std::cout );
- BOOST_CHECK_EQUAL( tr.p_assertions_failed, (std::size_t)9 );
- BOOST_CHECK( !tr.p_aborted );
+ BOOST_TEST( tr.p_assertions_failed == 9U );
+ BOOST_TEST( !tr.p_aborted );
}
@@ -109,8 +109,8 @@
ut::test_results const& tr = ut::results_collector.results( test->p_id );
ut::unit_test_log.set_stream( std::cout );
- BOOST_CHECK_EQUAL( tr.p_assertions_failed, (std::size_t)7 );
- BOOST_CHECK( !tr.p_aborted );
+ BOOST_TEST( tr.p_assertions_failed == 7U );
+ BOOST_TEST( !tr.p_aborted );
}
//____________________________________________________________________________//
@@ -128,9 +128,9 @@
ut::test_results const& tr = ut::results_collector.results( test->p_id );
ut::unit_test_log.set_stream( std::cout );
- BOOST_CHECK_EQUAL( tr.p_assertions_failed, (std::size_t)2 );
- BOOST_CHECK( !tr.p_aborted );
- BOOST_CHECK( !tr.passed() );
+ BOOST_TEST( tr.p_assertions_failed == 2U );
+ BOOST_TEST( !tr.p_aborted );
+ BOOST_TEST( !tr.passed() );
}
//____________________________________________________________________________//
Modified: trunk/libs/test/test/test_datasets_src/test_random.cpp
==============================================================================
--- trunk/libs/test/test/test_datasets_src/test_random.cpp (original)
+++ trunk/libs/test/test/test_datasets_src/test_random.cpp 2013-02-04 03:34:26 EST (Mon, 04 Feb 2013)
@@ -15,7 +15,7 @@
// Boost.Test
#include <boost/test/unit_test.hpp>
-#ifndef BOOST_NO_CXX11_HDR_RANDOM
+#ifndef BOOST_NO_0X_HDR_RANDOM
#include <boost/test/data/monomorphic/generators/random.hpp>
#include <boost/test/data/monomorphic/zip.hpp>
@@ -134,7 +134,7 @@
//____________________________________________________________________________//
-#endif // BOOST_NO_CXX11_HDR_RANDOM
+#endif // BOOST_NO_0X_HDR_RANDOM
// EOF
Modified: trunk/libs/test/test/test_files/errors_handling_test.pattern
==============================================================================
--- trunk/libs/test/test/test_files/errors_handling_test.pattern (original)
+++ trunk/libs/test/test/test_files/errors_handling_test.pattern 2013-02-04 03:34:26 EST (Mon, 04 Feb 2013)
@@ -3,7 +3,7 @@
log level: log_successful_tests; error type: no error;
164: Entering test case "error_on_demand"
-99: info: check 'no error' passed
+99: info: check 'no error' has passed
Leaving test case "error_on_demand"
===========================
Modified: trunk/libs/test/test/test_files/errors_handling_test.pattern2
==============================================================================
--- trunk/libs/test/test/test_files/errors_handling_test.pattern2 (original)
+++ trunk/libs/test/test/test_files/errors_handling_test.pattern2 2013-02-04 03:34:26 EST (Mon, 04 Feb 2013)
@@ -3,7 +3,7 @@
log level: log_successful_tests; error type: no error;
164: Entering test case "error_on_demand"
-99: info: check 'no error' passed
+99: info: check 'no error' has passed
Leaving test case "error_on_demand"
===========================
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 2013-02-04 03:34:26 EST (Mon, 04 Feb 2013)
@@ -1,63 +1,63 @@
-139: warning: in "test_BOOST_WARN": condition sizeof(int) == sizeof(short) is not satisfied
-142: info: check sizeof(unsigned char) == sizeof(char) passed
-164: error: in "test_BOOST_CHECK": check false failed
-165: error: in "test_BOOST_CHECK": check 1==2 failed
-166: error: in "test_BOOST_CHECK": check i==1 failed
-169: info: check i==2 passed
-176: error: in "test_BOOST_REQUIRE": not aborted
-178: fatal error: in "test_BOOST_REQUIRE": critical check false failed
-182: fatal error: in "test_BOOST_REQUIRE": critical check j > 5 failed
-185: info: check j < 5 passed
-185: error: in "test_BOOST_REQUIRE": not aborted
-199: info: check 'object size 33 is too small' passed
-216: error: in "test_BOOST_CHECK_MESSAGE": Well, may be that what I believe in
-218: error: in "test_BOOST_CHECK_MESSAGE": Checking predicate failed. Some explanation
-221: info: check 'Could it fail?' passed
-226: error: in "test_BOOST_CHECK_MESSAGE": Comparing 1 and 2: some explanation
-233: fatal error: in "test_BOOST_REQUIRE_MESSAGE": Here we should stop
-236: info: check 'That's OK' passed
-236: error: in "test_BOOST_REQUIRE_MESSAGE": not aborted
-243: error: in "test_BOOST_ERROR": Fail to miss an error
-250: fatal error: in "test_BOOST_FAIL": No! No! Show must go on.
-266: error: in "test_BOOST_CHECK_THROW": exception my_exception is expected
-269: warning: in "test_BOOST_CHECK_THROW": exception my_exception is expected
-272: fatal error: in "test_BOOST_CHECK_THROW": exception my_exception is expected
-278: info: check 'exception my_exception is caught' passed
-285: error: in "test_BOOST_CHECK_EXCEPTION": incorrect exception my_exception is caught
-288: info: check 'incorrect exception my_exception is caught' passed
-300: error: in "test_BOOST_CHECK_NO_THROW": exception thrown by throw my_exception()
-346: error: in "test_BOOST_CHECK_EQUAL": check i == j failed [1 != 2]
-352: error: in "test_BOOST_CHECK_EQUAL": check str1 == str2 failed [test1 != test12]
-355: error: in "test_BOOST_CHECK_EQUAL": check i+1 == j failed [4 != 2]
-358: info: check str1 == str3+1 passed
-367: fatal error: in "test_BOOST_CHECK_EQUAL": critical check str1 == str2 failed [test != null string]
-373: warning: in "test_BOOST_CHECK_EQUAL": condition b1 == b2 is not satisfied [B(1) != B(2)]
-379: error: in "test_BOOST_CHECK_EQUAL": check c1 == c3 failed [C(0,100) != C(1,102)]. Index mismatch
-380: error: in "test_BOOST_CHECK_EQUAL": check c1 == c2 failed [C(0,100) != C(0,101)]. Id mismatch
-384: error: in "test_BOOST_CHECK_EQUAL": check ch1 == ch2 failed [0xfffffffe != 0xfffffffd]
-395: error: in "test_BOOST_CHECK_LOGICAL_EXPR": check ++i != j failed [2 == 2]
-397: error: in "test_BOOST_CHECK_LOGICAL_EXPR": check i < j failed [2 >= 2]
-398: error: in "test_BOOST_CHECK_LOGICAL_EXPR": check i > j failed [2 <= 2]
-405: error: in "test_BOOST_CHECK_LOGICAL_EXPR": check i <= j failed [3 > 2]
-406: error: in "test_BOOST_CHECK_LOGICAL_EXPR": check j >= i failed [2 < 3]
-411: error: in "test_BOOST_CHECK_LOGICAL_EXPR": check str1 != str2 failed [test1 == test1]
-441: error: in "test_BOOST_CHECK_PREDICATE": check is_even( i ) failed for ( 17 )
-444: error: in "test_BOOST_CHECK_PREDICATE": check not_equal_to<int>()( i, 17 ) failed for ( 17, 17 )
-450: warning: in "test_BOOST_CHECK_PREDICATE": condition moo( 12, i, j ) is not satisfied for ( 12, 17, 15 )
-458: error: in "test_BOOST_CHECK_PREDICATE": check compare_lists( l1, l2 ) failed for ( , ). Different sizes [2!=0]
-469: error: in "test_BOOST_REQUIRE_PREDICATE": not aborted
-471: fatal error: in "test_BOOST_REQUIRE_PREDICATE": critical check less_equal<int>()( arg2, arg1 ) failed for ( 2, 1 )
-492: error: in "test_BOOST_CHECK_EQUAL_COLLECTIONS": check { testlist.begin(), testlist.end() } == { pattern, pattern+7 } failed.
+154: warning: in "test_BOOST_WARN": condition sizeof(int) == sizeof(short) is not satisfied
+157: info: check sizeof(unsigned char) == sizeof(char) has passed
+179: error: in "test_BOOST_CHECK": check false has failed
+180: error: in "test_BOOST_CHECK": check 1==2 has failed
+181: error: in "test_BOOST_CHECK": check i==1 has failed
+184: info: check i==2 has passed
+191: error: in "test_BOOST_REQUIRE": not aborted
+193: fatal error: in "test_BOOST_REQUIRE": critical check false has failed
+197: fatal error: in "test_BOOST_REQUIRE": critical check j > 5 has failed
+200: info: check j < 5 has passed
+200: error: in "test_BOOST_REQUIRE": not aborted
+214: info: check 'object size 33 is too small' has passed
+231: error: in "test_BOOST_CHECK_MESSAGE": Well, may be that what I believe in
+233: error: in "test_BOOST_CHECK_MESSAGE": Checking predicate failed. Some explanation
+236: info: check 'Could it fail?' has passed
+241: error: in "test_BOOST_CHECK_MESSAGE": Comparing 1 and 2: some explanation
+248: fatal error: in "test_BOOST_REQUIRE_MESSAGE": Here we should stop
+251: info: check 'That's OK' has passed
+251: error: in "test_BOOST_REQUIRE_MESSAGE": not aborted
+258: error: in "test_BOOST_ERROR": Fail to miss an error
+265: fatal error: in "test_BOOST_FAIL": No! No! Show must go on.
+281: error: in "test_BOOST_CHECK_THROW": exception my_exception is expected
+284: warning: in "test_BOOST_CHECK_THROW": exception my_exception is expected
+287: fatal error: in "test_BOOST_CHECK_THROW": exception my_exception is expected
+293: info: check 'exception my_exception is caught' has passed
+300: error: in "test_BOOST_CHECK_EXCEPTION": incorrect exception my_exception is caught
+303: info: check 'incorrect exception my_exception is caught' has passed
+315: error: in "test_BOOST_CHECK_NO_THROW": exception thrown by throw my_exception()
+361: error: in "test_BOOST_CHECK_EQUAL": check i == j has failed [1 != 2]
+367: error: in "test_BOOST_CHECK_EQUAL": check str1 == str2 has failed [test1 != test12]
+370: error: in "test_BOOST_CHECK_EQUAL": check i+1 == j has failed [4 != 2]
+373: info: check str1 == str3+1 has passed
+382: fatal error: in "test_BOOST_CHECK_EQUAL": critical check str1 == str2 has failed [test != null string]
+388: warning: in "test_BOOST_CHECK_EQUAL": condition b1 == b2 is not satisfied [B(1) != B(2)]
+394: error: in "test_BOOST_CHECK_EQUAL": check c1 == c3 has failed [C(0,100) != C(1,102)]. Index mismatch
+395: error: in "test_BOOST_CHECK_EQUAL": check c1 == c2 has failed [C(0,100) != C(0,101)]. Id mismatch
+399: error: in "test_BOOST_CHECK_EQUAL": check ch1 == ch2 has failed [0xfffffffe != 0xfffffffd]
+410: error: in "test_BOOST_CHECK_LOGICAL_EXPR": check ++i != j has failed [2 == 2]
+412: error: in "test_BOOST_CHECK_LOGICAL_EXPR": check i < j has failed [2 >= 2]
+413: error: in "test_BOOST_CHECK_LOGICAL_EXPR": check i > j has failed [2 <= 2]
+420: error: in "test_BOOST_CHECK_LOGICAL_EXPR": check i <= j has failed [3 > 2]
+421: error: in "test_BOOST_CHECK_LOGICAL_EXPR": check j >= i has failed [2 < 3]
+426: error: in "test_BOOST_CHECK_LOGICAL_EXPR": check str1 != str2 has failed [test1 == test1]
+456: error: in "test_BOOST_CHECK_PREDICATE": check is_even( i ) has failed for ( 17 )
+459: error: in "test_BOOST_CHECK_PREDICATE": check not_equal_to<int>()( i, 17 ) has failed for ( 17, 17 )
+465: warning: in "test_BOOST_CHECK_PREDICATE": condition moo( 12, i, j ) is not satisfied for ( 12, 17, 15 )
+473: error: in "test_BOOST_CHECK_PREDICATE": check compare_lists( l1, l2 ) has failed for ( , ). Different sizes [2!=0]
+484: error: in "test_BOOST_REQUIRE_PREDICATE": not aborted
+486: fatal error: in "test_BOOST_REQUIRE_PREDICATE": critical check less_equal<int>()( arg2, arg1 ) has failed for ( 2, 1 )
+507: error: in "test_BOOST_CHECK_EQUAL_COLLECTIONS": check { testlist.begin(), testlist.end() } == { pattern, pattern+7 } has failed.
Mismatch in a position 2: 4 != 3
Mismatch in a position 5: 7 != 6
-493: error: in "test_BOOST_CHECK_EQUAL_COLLECTIONS": check { testlist.begin(), testlist.end() } == { pattern, pattern+2 } failed.
+508: error: in "test_BOOST_CHECK_EQUAL_COLLECTIONS": check { testlist.begin(), testlist.end() } == { pattern, pattern+2 } has failed.
Collections size mismatch: 7 != 2
-502: error: in "test_BOOST_CHECK_BITWISE_EQUAL": check (char)0x06 =.= (char)0x16 failed.
+517: error: in "test_BOOST_CHECK_BITWISE_EQUAL": check (char)0x06 =.= (char)0x16 has failed.
Mismatch in a position 4
-505: warning: in "test_BOOST_CHECK_BITWISE_EQUAL": condition (char)0x26 =.= (char)0x04 is not satisfied.
+520: 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
-508: fatal error: in "test_BOOST_CHECK_BITWISE_EQUAL": critical check (char)0x26 =.= (int)0x26 failed.
+523: fatal error: in "test_BOOST_CHECK_BITWISE_EQUAL": critical check (char)0x26 =.= (int)0x26 has failed.
Operands bit sizes mismatch: 8 != 32
still testing
1+1=2
@@ -66,70 +66,97 @@
0x14
20
0: fatal error in "test_BOOST_TEST_CHECKPOINT": C string: some error
-543: last checkpoint: Going to do a silly things
+558: last checkpoint: Going to do a silly things
0: fatal error in "test_BOOST_TEST_PASSPOINT": unknown type
-554: last checkpoint
-611: error: in "test_context_logging": check false failed
+569: last checkpoint
+595: error: in "test_context_logging": check false has failed
Failure occurred in a following context:
some context
-615: error: in "test_context_logging": check false failed
+599: error: in "test_context_logging": check false has failed
Failure occurred in a following context:
some more context: 12
-620: error: in "test_context_logging": check false failed
+604: error: in "test_context_logging": check false has failed
Failure occurred in a following context:
info 1
info 2
info 3
-623: error: in "test_context_logging": check false failed
+607: error: in "test_context_logging": check false has failed
Failure occurred in a following context:
some sticky context
-626: error: in "test_context_logging": check false failed
+610: error: in "test_context_logging": check false has failed
Failure occurred in a following context:
some sticky context
more context
-629: error: in "test_context_logging": check false failed
+613: error: in "test_context_logging": check false has failed
Failure occurred in a following context:
some sticky context
different subcontext
-633: error: in "test_context_logging": check false failed
+617: error: in "test_context_logging": check false has failed
Failure occurred in a following context:
outer context
-636: error: in "test_context_logging": check false failed
+620: error: in "test_context_logging": check false has failed
Failure occurred in a following context:
outer context
inner context
-639: error: in "test_context_logging": check false failed
+623: error: in "test_context_logging": check false has failed
Failure occurred in a following context:
outer context
-670: info: check true passed
-671: error: in "test_BOOST_TEST_universal": check false failed
-674: info: check bc passed
-677: error: in "test_BOOST_TEST_universal": check i == 2 failed [1 != 2]
-678: error: in "test_BOOST_TEST_universal": check i != 1 failed [1 == 1]
-679: error: in "test_BOOST_TEST_universal": check i > 2 failed [1 <= 2]
-680: error: in "test_BOOST_TEST_universal": check i < 1 failed [1 >= 1]
-681: error: in "test_BOOST_TEST_universal": check i <= 0 failed [1 > 0]
-682: error: in "test_BOOST_TEST_universal": check i >= 5 failed [1 < 5]
-685: error: in "test_BOOST_TEST_universal": check i+j >= 5 failed [1 + 2 < 5]
-686: error: in "test_BOOST_TEST_universal": check j-i == 2 failed [2 - 1 != 2]
-689: error: in "test_BOOST_TEST_universal": check *p == 2 failed [1 != 2]
-691: error: in "test_BOOST_TEST_universal": check j-*p == 0 failed [2 - 1 != 0]
-693: info: check ( i > 5, true ) passed
-697: error: in "test_BOOST_TEST_universal": check FooType() failed [(bool)0 is false]
-698: error: in "test_BOOST_TEST_universal": check *F failed [(bool)0 is false]
-699: error: in "test_BOOST_TEST_universal": check **F failed [(bool)0 is false]
-700: error: in "test_BOOST_TEST_universal": check ***F failed [(bool)0 is false]
-701: error: in "test_BOOST_TEST_universal": check &F > 100 failed [10 <= 100]
-702: error: in "test_BOOST_TEST_universal": check &*F > 100 failed [10 <= 100]
-704: error: in "test_BOOST_TEST_universal": check (i == 1) & (j == 1) failed [1 & 0]
-705: error: in "test_BOOST_TEST_universal": check (i == 2) | (j == 1) failed [0 | 0]
-707: error: in "test_BOOST_TEST_universal": check ( i == 1 && j == 1 ) failed
-708: error: in "test_BOOST_TEST_universal": check ( i == 2 || j == 1 ) failed
-710: error: in "test_BOOST_TEST_universal": This message reported instead
-714: info: check true passed
-720: info: check true passed
-732: error: in "test_BOOST_TEST_universal": check v <= l failed.
+652: info: check true has passed
+653: error: in "test_BOOST_TEST_basic_arithmetic_op": check false has failed
+656: info: check bc has passed
+660: error: in "test_BOOST_TEST_basic_arithmetic_op": check i == 2 has failed [1 != 2]
+661: error: in "test_BOOST_TEST_basic_arithmetic_op": check i != 1 has failed [1 == 1]
+662: error: in "test_BOOST_TEST_basic_arithmetic_op": check i > 2 has failed [1 <= 2]
+663: error: in "test_BOOST_TEST_basic_arithmetic_op": check i < 1 has failed [1 >= 1]
+664: error: in "test_BOOST_TEST_basic_arithmetic_op": check i <= 0 has failed [1 > 0]
+665: error: in "test_BOOST_TEST_basic_arithmetic_op": check i >= 5 has failed [1 < 5]
+668: error: in "test_BOOST_TEST_basic_arithmetic_op": check i+j >= 5 has failed [1 + 2 < 5]
+669: error: in "test_BOOST_TEST_basic_arithmetic_op": check j-i == 2 has failed [2 - 1 != 2]
+672: error: in "test_BOOST_TEST_basic_arithmetic_op": check *p == 2 has failed [1 != 2]
+674: error: in "test_BOOST_TEST_basic_arithmetic_op": check j-*p == 0 has failed [2 - 1 != 0]
+676: info: check ( i > 5, true ) has passed
+680: error: in "test_BOOST_TEST_basic_arithmetic_op": check FooType() has failed [(bool)0 is false]
+681: error: in "test_BOOST_TEST_basic_arithmetic_op": check *F has failed [(bool)0 is false]
+682: error: in "test_BOOST_TEST_basic_arithmetic_op": check **F has failed [(bool)0 is false]
+683: error: in "test_BOOST_TEST_basic_arithmetic_op": check ***F has failed [(bool)0 is false]
+684: error: in "test_BOOST_TEST_basic_arithmetic_op": check &F > 100 has failed [10 <= 100]
+685: error: in "test_BOOST_TEST_basic_arithmetic_op": check &*F > 100 has failed [10 <= 100]
+687: error: in "test_BOOST_TEST_basic_arithmetic_op": check (i == 1) & (j == 1) has failed [true & false]
+688: error: in "test_BOOST_TEST_basic_arithmetic_op": check (i == 2) | (j == 1) has failed [false | false]
+690: error: in "test_BOOST_TEST_basic_arithmetic_op": check ( i == 1 && j == 1 ) has failed
+691: error: in "test_BOOST_TEST_basic_arithmetic_op": check ( i == 2 || j == 1 ) has failed
+695: info: check true has passed
+701: info: check true has passed
+703: error: in "test_BOOST_TEST_basic_arithmetic_op": This message reported instead including 1 and 2
+723: error: in "test_BOOST_TEST_collection_comp": check v <= l has failed.
Mismatch in a position 2: 3 > 2
-733: error: in "test_BOOST_TEST_universal": check v == l failed.
+724: error: in "test_BOOST_TEST_collection_comp": check v == l has failed.
Mismatch in a position 1: 2 != 3
Mismatch in a position 2: 3 != 2
+745: error: in "test_BOOST_TEST_fpv_comp": check d1 == d2 has failed [1e-05 != 1e-05]
+747: error: in "test_BOOST_TEST_fpv_comp": check d1 == d2 has failed [1e-05 != 1e-05]. Relative difference exceeds tolerance [0.000908265 > 1e-07]
+749: error: in "test_BOOST_TEST_fpv_comp": check d1 != f1 has failed [1e-05 == 1.10000001e-05]. Relative difference is within tolerance [7.81041e-09 < 1e-07]
+753: error: in "test_BOOST_TEST_fpv_comp": check d1 > d2 has failed [1e-05 <= 1e-05]
+754: error: in "test_BOOST_TEST_fpv_comp": check d1+1./1e20 > d2 has failed [1e-05 + 1e-20 <= 1e-05]. Relative difference exceeds tolerance [0.000908265 > 1e-07]
+756: error: in "test_BOOST_TEST_fpv_comp": check d2 <= d1 has failed [1e-05 > 1e-05]. Relative difference exceeds tolerance [0.000909091 > 1e-07]
+759: error: in "test_BOOST_TEST_fpv_comp": check d1-1e-5 == 0. has failed [1e-05 - 1e-05 != 0]. Absolute value exceeds tolerance [|1e-06| > 1e-07]
+760: error: in "test_BOOST_TEST_fpv_comp": check d1-1e-5 != 0. has failed [1e-05 - 1e-05 == 0]. Absolute value is within tolerance [|1e-06| < 0.0001]
+761: error: in "test_BOOST_TEST_fpv_comp": check 0. != 1e-5-d1 has failed [0 == -1e-06]. Absolute value is within tolerance [|-1e-06| < 0.0001]
+762: error: in "test_BOOST_TEST_fpv_comp": check d2-1e-5 < 0. has failed [1e-05 - 1e-05 >= 0]. Absolute value exceeds tolerance [|1.01e-06| > 1e-06]
+805: error: in "test_BOOST_TEST_cstring_comp": check str1 == str2 has failed [test1 != test12]
+806: error: in "test_BOOST_TEST_cstring_comp": check str1 == str3 has failed [test1 != test2]
+807: error: in "test_BOOST_TEST_cstring_comp": check str3 == str2 has failed [test2 != test12]
+808: error: in "test_BOOST_TEST_cstring_comp": check str1 == str4 has failed [test1 != test3]
+809: error: in "test_BOOST_TEST_cstring_comp": check str3 == str4 has failed [test2 != test3]
+810: error: in "test_BOOST_TEST_cstring_comp": check str1 == str5 has failed [test1 != null string]
+812: error: in "test_BOOST_TEST_cstring_comp": check str1 != (str6+1) has failed [test1 == test1]
+813: error: in "test_BOOST_TEST_cstring_comp": check str5 != str5 has failed [null string == null string]
+815: error: in "test_BOOST_TEST_cstring_comp": check str3 < str1 has failed [test2 >= test1]
+816: error: in "test_BOOST_TEST_cstring_comp": check str1 >= str2 has failed [test1 < test12]
+827: error: in "test_BOOST_TEST_bitwise": check a == b has failed [171 != 136]. Bitwise comparison failed
+Mismatch in a position 0
+Mismatch in a position 1
+Mismatch in a position 5
+828: error: in "test_BOOST_TEST_bitwise": check c == b has failed [138 != 136]. Bitwise comparison failed
+Mismatch in a position 1
+Operands bit sizes mismatch: 16 != 32
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 2013-02-04 03:34:26 EST (Mon, 04 Feb 2013)
@@ -43,15 +43,25 @@
BOOST_CHECK_CLOSE( fp1, fp2, epsilon ); \
/**/
+#ifdef BOOST_TEST_NO_OLD_TOOLS
+
#define CHECK_NOT_CLOSE( first, second, e ) \
fp1 = static_cast<FPT>(first); \
fp2 = static_cast<FPT>(second); \
epsilon = static_cast<FPT>(e); \
\
- BOOST_CHECK_PREDICATE( \
- bind(not_func, bind(check_is_close, _1, _2, _3)), \
- (fp1)(fp2)(::fpc::percent_tolerance( epsilon )) ); \
+ BOOST_TEST( fp1 != fp2, fpc::percent_tolerance( epsilon ) ); \
+
+#else
+
+#define CHECK_NOT_CLOSE( first, second, e ) \
+ fp1 = static_cast<FPT>(first); \
+ fp2 = static_cast<FPT>(second); \
+ epsilon = static_cast<FPT>(e); \
+ \
+ BOOST_CHECK( !check_is_close( fp1, fp2, ::fpc::percent_tolerance( epsilon ) ) ); \
/**/
+#endif
FPT fp1, fp2, epsilon;
@@ -93,15 +103,26 @@
BOOST_CHECK_CLOSE( fp1, fp2, epsilon ); \
/**/
+#ifdef BOOST_TEST_NO_OLD_TOOLS
+
#define CHECK_NOT_CLOSE( first, second, e ) \
fp1 = static_cast<FPT>(first); \
fp2 = static_cast<FPT>(second); \
epsilon = static_cast<FPT>(e); \
\
- BOOST_CHECK_PREDICATE( \
- bind(not_func, bind(check_is_close, _1, _2, _3)), \
- (fp1)(fp2)(epsilon) ); \
+ BOOST_TEST( fp1 != fp2, epsilon ); \
+
+#else
+
+#define CHECK_NOT_CLOSE( first, second, e ) \
+ fp1 = static_cast<FPT>(first); \
+ fp2 = static_cast<FPT>(second); \
+ epsilon = static_cast<FPT>(e); \
+ \
+ BOOST_CHECK( !check_is_close( fp1, fp2, epsilon ) ); \
/**/
+#endif
+
FPT fp1, fp2, epsilon;
@@ -135,9 +156,9 @@
BOOST_AUTO_TEST_CASE( test_type_mismatch )
{
- BOOST_CHECK_CLOSE_FRACTION( 2, 2.1, 0.06 );
- BOOST_CHECK_CLOSE( 2.1, 2, 6 );
- BOOST_CHECK_CLOSE( 2.1, 2.f, 6 );
+ BOOST_CHECK_CLOSE_FRACTION( 2., 2.1, 0.06 );
+ BOOST_CHECK_CLOSE( 2.1, 2., 6. );
+ BOOST_CHECK_CLOSE( 2.1, 2.f, 6. );
}
//____________________________________________________________________________//
@@ -147,7 +168,7 @@
BOOST_CHECK_SMALL( 1e-6, 1e-5 );
BOOST_CHECK_SMALL( -1e-6, 1e-5 );
- BOOST_CHECK_PREDICATE( bind(not_func, bind(check_is_small, _1, _2 )), (1e-6)(1e-7) );
+ BOOST_TEST( 1e-6 != 0., 1e-7 );
}
//____________________________________________________________________________//
@@ -160,20 +181,20 @@
double fp2 = 1.00000002;
double epsilon = 1e-6;
- ::fpc::close_at_tolerance<double> pred( ::fpc::percent_tolerance( epsilon ), ::fpc::FPC_WEAK );
- BOOST_CHECK_PREDICATE( pred, (fp1)(fp2) );
+// ::fpc::close_at_tolerance<double> pred( ::fpc::percent_tolerance( epsilon ), ::fpc::FPC_WEAK );
+// BOOST_CHECK_PREDICATE( pred, (fp1)(fp2) );
- BOOST_CHECK_PREDICATE( bind(not_func, bind(check_is_close, _1, _2, _3)),
- (fp1)(fp2)( ::fpc::percent_tolerance( epsilon )) );
+// BOOST_CHECK_PREDICATE( bind(not_func, bind(check_is_close, _1, _2, _3)),
+// (fp1)(fp2)( ::fpc::percent_tolerance( epsilon )) );
fp1 = 1.23456e-10;
fp2 = 1.23457e-10;
epsilon = 8.1e-4;
- BOOST_CHECK_PREDICATE( ::fpc::close_at_tolerance<double>( ::fpc::percent_tolerance( epsilon ), ::fpc::FPC_WEAK ), (fp1)(fp2) );
- BOOST_CHECK_PREDICATE(
- bind(not_func,
- bind( ::fpc::close_at_tolerance<double>( ::fpc::percent_tolerance( epsilon ) ), _1, _2)), (fp1)(fp2) );
+// BOOST_CHECK_PREDICATE( ::fpc::close_at_tolerance<double>( ::fpc::percent_tolerance( epsilon ), ::fpc::FPC_WEAK ), (fp1)(fp2) );
+// BOOST_CHECK_PREDICATE(
+// bind(not_func,
+// bind( ::fpc::close_at_tolerance<double>( ::fpc::percent_tolerance( epsilon ) ), _1, _2)), (fp1)(fp2) );
}
//____________________________________________________________________________//
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 2013-02-04 03:34:26 EST (Mon, 04 Feb 2013)
@@ -36,8 +36,8 @@
# pragma warning(disable: 4702) // unreachable code
#endif
-using namespace boost::unit_test;
-using namespace boost::test_tools;
+namespace ut=boost::unit_test;
+namespace tt=boost::test_tools;
//____________________________________________________________________________//
@@ -56,6 +56,21 @@
//____________________________________________________________________________//
+// thanks to http://stackoverflow.com/questions/9226400/portable-printing-of-exponent-of-a-double-to-c-iostreams
+#ifdef BOOST_MSVC
+struct ScientificNotationExponentOutputNormalizer {
+ ScientificNotationExponentOutputNormalizer() : m_old_format(_set_output_format(_TWO_DIGIT_EXPONENT)) {}
+
+ ~ScientificNotationExponentOutputNormalizer() { _set_output_format(m_old_format); }
+private:
+ unsigned m_old_format;
+};
+#else
+struct ScientificNotationExponentOutputNormalizer {};
+#endif
+
+//____________________________________________________________________________//
+
class bool_convertible
{
struct Tester {};
@@ -78,15 +93,15 @@
std::string match_file_name( "./test_files/test_tools_test.pattern" );
std::string save_file_name( "test_tools_test.pattern" );
-output_test_stream& ots()
+tt::output_test_stream& ots()
{
- static boost::shared_ptr<output_test_stream> inst;
+ static boost::shared_ptr<tt::output_test_stream> inst;
if( !inst ) {
inst.reset(
- framework::master_test_suite().argc <= 1
- ? new output_test_stream( runtime_config::save_pattern() ? save_file_name : match_file_name, !runtime_config::save_pattern() )
- : new output_test_stream( framework::master_test_suite().argv[1], !runtime_config::save_pattern() ) );
+ ut::framework::master_test_suite().argc <= 1
+ ? new tt::output_test_stream( ut::runtime_config::save_pattern() ? save_file_name : match_file_name, !ut::runtime_config::save_pattern() )
+ : new tt::output_test_stream( ut::framework::master_test_suite().argv[1], !ut::runtime_config::save_pattern() ) );
}
return *inst;
@@ -94,51 +109,51 @@
//____________________________________________________________________________//
-#define TEST_CASE( name ) \
-void name ## _impl(); \
-void name ## _impl_defer(); \
- \
-BOOST_AUTO_TEST_CASE( name ) \
-{ \
- test_case* impl = make_test_case( &name ## _impl, \
- #name, \
- __FILE__, \
- __LINE__ ); \
- \
- unit_test_log.set_stream( ots() ); \
- unit_test_log.set_threshold_level( log_nothing ); \
- unit_test_log.set_formatter( new shorten_lf ); \
- framework::run( impl ); \
- \
- unit_test_log.set_threshold_level( \
- runtime_config::log_level() != invalid_log_level \
- ? runtime_config::log_level() \
- : log_all_errors ); \
- unit_test_log.set_format( runtime_config::log_format());\
- unit_test_log.set_stream( std::cout ); \
- BOOST_CHECK( ots().match_pattern() ); \
-} \
- \
-void name ## _impl() \
-{ \
- unit_test_log.set_threshold_level( log_all_errors ); \
- \
- name ## _impl_defer(); \
- \
- unit_test_log.set_threshold_level( log_nothing ); \
-} \
- \
-void name ## _impl_defer() \
+#define TEST_CASE( name ) \
+void name ## _impl(); \
+void name ## _impl_defer(); \
+ \
+BOOST_AUTO_TEST_CASE( name ) \
+{ \
+ ut::test_case* impl = ut::make_test_case(&name ## _impl, \
+ #name, \
+ __FILE__, \
+ __LINE__ ); \
+ \
+ ut::unit_test_log.set_stream( ots() ); \
+ ut::unit_test_log.set_threshold_level( ut::log_nothing ); \
+ ut::unit_test_log.set_formatter( new shorten_lf ); \
+ ut::framework::run( impl ); \
+ \
+ ut::unit_test_log.set_threshold_level( \
+ ut::runtime_config::log_level() != ut::invalid_log_level \
+ ? ut::runtime_config::log_level() \
+ : ut::log_all_errors ); \
+ ut::unit_test_log.set_format( ut::runtime_config::log_format());\
+ ut::unit_test_log.set_stream( std::cout ); \
+ BOOST_TEST( ots().match_pattern() ); \
+} \
+ \
+void name ## _impl() \
+{ \
+ ut::unit_test_log.set_threshold_level( ut::log_all_errors ); \
+ \
+ name ## _impl_defer(); \
+ \
+ ut::unit_test_log.set_threshold_level( ut::log_nothing ); \
+} \
+ \
+void name ## _impl_defer() \
/**/
//____________________________________________________________________________//
TEST_CASE( test_BOOST_WARN )
{
- unit_test_log.set_threshold_level( log_warnings );
+ ut::unit_test_log.set_threshold_level( ut::log_warnings );
BOOST_WARN( sizeof(int) == sizeof(short) );
- unit_test_log.set_threshold_level( log_successful_tests );
+ ut::unit_test_log.set_threshold_level( ut::log_successful_tests );
BOOST_WARN( sizeof(unsigned char) == sizeof(char) );
}
@@ -165,7 +180,7 @@
BOOST_CHECK( 1==2 );
BOOST_CHECK( i==1 );
- unit_test_log.set_threshold_level( log_successful_tests );
+ ut::unit_test_log.set_threshold_level( ut::log_successful_tests );
BOOST_CHECK( i==2 );
}
@@ -181,7 +196,7 @@
CHECK_CRITICAL_TOOL_USAGE( BOOST_REQUIRE( j > 5 ) );
- unit_test_log.set_threshold_level( log_successful_tests );
+ ut::unit_test_log.set_threshold_level( ut::log_successful_tests );
CHECK_CRITICAL_TOOL_USAGE( BOOST_REQUIRE( j < 5 ) );
}
@@ -195,7 +210,7 @@
BOOST_WARN_MESSAGE( obj_size <= 8,
"object size " << obj_size << " is too big to be efficiently passed by value" );
- unit_test_log.set_threshold_level( log_successful_tests );
+ ut::unit_test_log.set_threshold_level( ut::log_successful_tests );
BOOST_WARN_MESSAGE( obj_size > 8, "object size " << obj_size << " is too small" );
}
@@ -217,7 +232,7 @@
BOOST_CHECK_MESSAGE( test_pred1(), "Checking predicate failed" );
- unit_test_log.set_threshold_level( log_successful_tests );
+ ut::unit_test_log.set_threshold_level( ut::log_successful_tests );
BOOST_CHECK_MESSAGE( 2+2 == 4, "Could it fail?" );
int i = 1;
@@ -232,7 +247,7 @@
{
CHECK_CRITICAL_TOOL_USAGE( BOOST_REQUIRE_MESSAGE( false, "Here we should stop" ) );
- unit_test_log.set_threshold_level( log_successful_tests );
+ ut::unit_test_log.set_threshold_level( ut::log_successful_tests );
CHECK_CRITICAL_TOOL_USAGE( BOOST_REQUIRE_MESSAGE( true, "That's OK" ) );
}
@@ -265,13 +280,13 @@
int i=0;
BOOST_CHECK_THROW( i++, my_exception );
- unit_test_log.set_threshold_level( log_warnings );
+ ut::unit_test_log.set_threshold_level( ut::log_warnings );
BOOST_WARN_THROW( i++, my_exception );
- unit_test_log.set_threshold_level( log_all_errors );
+ ut::unit_test_log.set_threshold_level( ut::log_all_errors );
CHECK_CRITICAL_TOOL_USAGE( BOOST_REQUIRE_THROW( i++, my_exception ) );
- unit_test_log.set_threshold_level( log_successful_tests );
+ ut::unit_test_log.set_threshold_level( ut::log_successful_tests );
if( i/10 > 10 )
{}
else
@@ -284,7 +299,7 @@
{
BOOST_CHECK_EXCEPTION( throw my_exception( 1 ), my_exception, is_critical ); // unreachable code warning is expected
- unit_test_log.set_threshold_level( log_successful_tests );
+ ut::unit_test_log.set_threshold_level( ut::log_successful_tests );
BOOST_CHECK_EXCEPTION( throw my_exception( -1 ), my_exception, is_critical ); // unreachable code warning is expected
}
@@ -351,13 +366,13 @@
char const* str2 = "test12";
BOOST_CHECK_EQUAL( str1, str2 );
- unit_test_log.set_threshold_level( log_successful_tests );
+ ut::unit_test_log.set_threshold_level( ut::log_successful_tests );
BOOST_CHECK_EQUAL( i+1, j );
char const* str3 = "1test1";
BOOST_CHECK_EQUAL( str1, str3+1 );
- unit_test_log.set_threshold_level( log_all_errors );
+ ut::unit_test_log.set_threshold_level( ut::log_all_errors );
str1 = NULL;
str2 = NULL;
BOOST_CHECK_EQUAL( str1, str2 );
@@ -369,10 +384,10 @@
B b1(1);
B b2(2);
- unit_test_log.set_threshold_level( log_warnings );
+ ut::unit_test_log.set_threshold_level( ut::log_warnings );
BOOST_WARN_EQUAL( b1, b2 );
- unit_test_log.set_threshold_level( log_all_errors );
+ ut::unit_test_log.set_threshold_level( ( ut::log_all_errors ) );
C c1( 0, 100 );
C c2( 0, 101 );
C c3( 1, 102 );
@@ -419,7 +434,7 @@
BOOST_TEST_DONT_PRINT_LOG_VALUE( std::list<int> )
-boost::test_tools::predicate_result
+boost::test_tools::assertion_result
compare_lists( std::list<int> const& l1, std::list<int> const& l2 )
{
if( l1.size() != l2.size() ) {
@@ -432,7 +447,7 @@
return true;
}
-
+#ifndef BOOST_TEST_NO_OLD_TOOLS
TEST_CASE( test_BOOST_CHECK_PREDICATE )
{
BOOST_CHECK_PREDICATE( is_even, (14) );
@@ -446,10 +461,10 @@
int j=15;
BOOST_CHECK_PREDICATE( boost::bind( is_even, boost::bind( &foo, _1, _2 ) ), (i)(j) );
- unit_test_log.set_threshold_level( log_warnings );
+ ut::unit_test_log.set_threshold_level( ut::log_warnings );
BOOST_WARN_PREDICATE( moo, (12)(i)(j) );
- unit_test_log.set_threshold_level( log_all_errors );
+ ut::unit_test_log.set_threshold_level( ( ut::log_all_errors ) );
std::list<int> l1, l2, l3;
l1.push_back( 1 );
l3.push_back( 1 );
@@ -472,10 +487,10 @@
}
//____________________________________________________________________________//
-
+#endif
TEST_CASE( test_BOOST_CHECK_EQUAL_COLLECTIONS )
{
- unit_test_log.set_threshold_level( log_all_errors );
+ ut::unit_test_log.set_threshold_level( ( ut::log_all_errors ) );
int pattern [] = { 1, 2, 3, 4, 5, 6, 7 };
@@ -501,10 +516,10 @@
BOOST_CHECK_BITWISE_EQUAL( (char)0x06, (char)0x16 );
- unit_test_log.set_threshold_level( log_warnings );
+ ut::unit_test_log.set_threshold_level( ut::log_warnings );
BOOST_WARN_BITWISE_EQUAL( (char)0x26, (char)0x04 );
- unit_test_log.set_threshold_level( log_all_errors );
+ ut::unit_test_log.set_threshold_level( ( ut::log_all_errors ) );
CHECK_CRITICAL_TOOL_USAGE( BOOST_REQUIRE_BITWISE_EQUAL( (char)0x26, (int)0x26 ) );
}
@@ -516,7 +531,7 @@
TEST_CASE( test_BOOST_TEST_MESSAGE )
{
- unit_test_log.set_threshold_level( log_messages );
+ ut::unit_test_log.set_threshold_level( ut::log_messages );
BOOST_TEST_MESSAGE( "still testing" );
BOOST_TEST_MESSAGE( "1+1=" << 2 );
@@ -574,37 +589,6 @@
//____________________________________________________________________________//
-int goo()
-{
- static int i = 0;
- return i++;
-}
-
-struct Foo : boost::noncopyable {
- static int copy_counter;
-
- Foo() {}
- Foo( Foo const& ) { copy_counter++; }
-};
-
-int Foo::copy_counter = 0;
-
-bool operator==( Foo const&, Foo const& ) { return true; }
-std::ostream& operator<<( std::ostream& os, Foo const& ) { return os << "Foo"; }
-
-BOOST_AUTO_TEST_CASE( test_argument_handling )
-{
- BOOST_CHECK_EQUAL( goo(), 0 );
- BOOST_CHECK_EQUAL( goo(), 1 );
- BOOST_CHECK_EQUAL( 2, goo() );
- BOOST_CHECK_EQUAL( 3, goo() );
- BOOST_CHECK_NE( goo(), 5 );
- BOOST_CHECK_EQUAL( Foo(), Foo() );
- BOOST_CHECK_EQUAL( Foo::copy_counter, 0 );
-}
-
-//____________________________________________________________________________//
-
TEST_CASE( test_context_logging )
{
BOOST_TEST_INFO( "some context" );
@@ -642,6 +626,8 @@
//____________________________________________________________________________//
+#ifndef BOOST_TEST_NO_NEW_TOOLS
+
class FooType {
public:
FooType& operator*() { return *this; }
@@ -649,23 +635,19 @@
int operator&() { return 10; }
};
-#ifndef BOOST_NO_CXX11_DECLTYPE
+#ifndef BOOST_NO_DECLTYPE
#define BOOST_TEST_FWD_1(P,M) BOOST_TEST(P)
-#define BOOST_TEST_FWD_3(P,M) BOOST_TEST(P)
-#else
-#define BOOST_TEST_FWD_1(P,M) BOOST_CHECK_MESSAGE( P, M );
-#define BOOST_TEST_FWD_3(P,M) BOOST_ERROR(M)
-#endif
-
-#if BOOST_PP_VARIADICS
#define BOOST_TEST_FWD_2(P,M) BOOST_TEST(P,M)
+#define BOOST_TEST_FWD_3(P,A,M) BOOST_TEST(P,A)
#else
+#define BOOST_TEST_FWD_1(P,M) BOOST_ERROR( M );
#define BOOST_TEST_FWD_2(P,M) BOOST_CHECK_MESSAGE( P, M );
+#define BOOST_TEST_FWD_3(P,A,M) BOOST_ERROR( M )
#endif
-TEST_CASE( test_BOOST_TEST_universal )
+TEST_CASE( test_BOOST_TEST_basic_arithmetic_op )
{
- unit_test_log.set_threshold_level( log_successful_tests );
+ ut::unit_test_log.set_threshold_level( ut::log_successful_tests );
BOOST_TEST( true );
BOOST_TEST( false );
@@ -674,6 +656,7 @@
BOOST_TEST( bc );
int i = 1;
+
BOOST_TEST( i == 2 );
BOOST_TEST( i != 1 );
BOOST_TEST( i > 2 );
@@ -682,13 +665,13 @@
BOOST_TEST( i >= 5 );
int j = 2;
- 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]" );
+ BOOST_TEST_FWD_1( i+j >= 5, "check i+j >= 5 has failed [1 + 2 < 5]" );
+ BOOST_TEST_FWD_1( j-i == 2, "check j-i == 2 has failed [2 - 1 != 2]" );
int* p = &i;
BOOST_TEST( *p == 2 );
- BOOST_TEST_FWD_1( j-*p == 0, "check j-*p == 0 failed [2 - 1 != 0]" );
+ BOOST_TEST_FWD_1( j-*p == 0, "check j-*p == 0 has failed [2 - 1 != 0]" );
BOOST_TEST(( i > 5, true ));
@@ -701,14 +684,12 @@
BOOST_TEST( &F > 100 );
BOOST_TEST( &*F > 100 );
- 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_FWD_1( (i == 1) & (j == 1), "check (i == 1) & (j == 1) has failed [true & false]" );
+ BOOST_TEST_FWD_1( (i == 2) | (j == 1), "check (i == 2) | (j == 1) has failed [false | false]" );
BOOST_TEST(( i == 1 && j == 1 ));
BOOST_TEST(( i == 2 || j == 1 ));
- BOOST_TEST_FWD_2( i+j==15,"This message reported instead");
-
// check correct behavior in if clause
if( true )
BOOST_TEST( true );
@@ -719,6 +700,16 @@
else
BOOST_TEST( true );
+ BOOST_TEST_FWD_2( i+j==15, "This message reported instead including " << i << " and " << j );
+
+ // Does not work
+ // BOOST_TEST( i == 1 && j == 1 );
+ // BOOST_TEST( i == 2 || j == 1 );
+ // BOOST_TEST( i > 5 ? false : true );
+}
+
+TEST_CASE( test_BOOST_TEST_collection_comp )
+{
std::vector<int> v;
v.push_back( 1 );
v.push_back( 2 );
@@ -729,17 +720,153 @@
l.push_back( 3 );
l.push_back( 2 );
- BOOST_TEST_FWD_3( v <= l, "check v <= l failed.\nMismatch in a position 2: 3 > 2" );
- BOOST_TEST_FWD_3( v == l, "check v == l failed.\nMismatch in a position 1: 2 != 3\nMismatch in a position 2: 3 != 2" );
+ BOOST_TEST_FWD_1( v <= l, "check v <= l has failed.\nMismatch in a position 2: 3 > 2" );
+ BOOST_TEST_FWD_1( v == l, "check v == l has failed.\nMismatch in a position 1: 2 != 3\nMismatch in a position 2: 3 != 2" );
+}
- // Does not work
- // BOOST_TEST( i == 1 && j == 1 );
- // BOOST_TEST( i == 2 || j == 1 );
- // BOOST_TEST( i > 5 ? false : true );
+//____________________________________________________________________________//
+
+namespace boost{ namespace test_tools{ namespace tt_detail{
+template<>
+struct print_log_value<double> {
+ void operator()( std::ostream& os, double d ) { os << std::setprecision(1) << d; }
+};
+}}}
+
+TEST_CASE( test_BOOST_TEST_fpv_comp )
+{
+ ScientificNotationExponentOutputNormalizer norm;
+
+ double d1 = 1.1e-5;
+ double d2 = 1.101e-5;
+ float f1 = 1.1e-5f;
+
+ BOOST_TEST( tt::fpc_tolerance<double>() == 0 );
+ BOOST_TEST( d1 == d2 );
+ BOOST_TEST( tt::fpc_tolerance<double>() == 0 );
+ BOOST_TEST( d1 == d2, tt::tolerance( 1e-7 ) );
+ BOOST_TEST( tt::fpc_tolerance<double>() == 0 );
+ BOOST_TEST( d1 != f1, tt::tolerance( 1e-7 ) );
+ BOOST_TEST( tt::fpc_tolerance<double>() == 0 );
+ BOOST_TEST( tt::fpc_tolerance<float>() == 0 );
+
+ BOOST_TEST( d1 > d2 );
+ BOOST_TEST_FWD_3( d1+1./1e20 > d2, 1e-5% tt::tolerance(), "check d1+1./1e20 > d2 has failed [1e-005 + 1e-020 <= 1e-005]. Relative difference exceeds tolerance [0.000908265 > 1e-007]" );
+ BOOST_TEST( tt::fpc_tolerance<double>() == 0 );
+ BOOST_TEST( d2 <= d1, tt::tolerance( tt::fpc::percent_tolerance( 1e-5 ) ) );
+ BOOST_TEST( tt::fpc_tolerance<double>() == 0 );
+
+ BOOST_TEST_FWD_3( d1-1e-5 == 0., tt::tolerance( 1e-7 ), "check d1-1e-5 == 0. has failed [1e-005 - 1e-005 != 0]. Absolute value exceeds tolerance [|1e-006| > 1e-007]" );
+ BOOST_TEST_FWD_3( d1-1e-5 != 0., tt::tolerance( 1e-4 ), "check d1-1e-5 != 0. has failed [1e-005 - 1e-005 == 0]. Absolute value is within tolerance [|1e-006| < 0.0001]" );
+ BOOST_TEST_FWD_3( 0. != 1e-5-d1, tt::tolerance( 1e-4 ), "check 0. != 1e-5-d1 has failed [0 == -1e-006]. Absolute value is within tolerance [|-1e-006| < 0.0001]" );
+ BOOST_TEST_FWD_3( d2-1e-5 < 0., tt::tolerance( 1e-6 ), "check d2-1e-5 < 0. has failed [1e-005 - 1e-005 >= 0]. Absolute value exceeds tolerance [|1.01e-006| > 1e-006]" );
+}
+
+//____________________________________________________________________________//
+
+BOOST_TEST_DECORATOR(
++ut::tolerance(1e-3)
+)
+BOOST_AUTO_TEST_CASE( test_BOOST_TEST_fpv_comp_using_decorator )
+{
+ BOOST_TEST( tt::fpc_tolerance<double>() == 1e-3 );
+
+ double d1 = 1.1e-5;
+ double d2 = 1.101e-5;
+ BOOST_TEST( d1 == d2 );
+ BOOST_TEST( d1 > d2 );
+}
+
+//____________________________________________________________________________//
+
+BOOST_TEST_DECORATOR(
++ut::tolerance( tt::fpc::percent_tolerance( 1. ) )
+)
+BOOST_AUTO_TEST_CASE( test_BOOST_TEST_fpv_comp_using_decorator_2 )
+{
+ BOOST_TEST( tt::fpc_tolerance<double>() == 1e-2 );
+
+ double d1 = 1.1e-5;
+ double d2 = 1.101e-5;
+ BOOST_TEST( d1 > d2 );
+}
+
+//____________________________________________________________________________//
+
+TEST_CASE( test_BOOST_TEST_cstring_comp )
+{
+ char const* str1 = "test1";
+ char const* str2 = "test12";
+ std::string str3 = "test2";
+ char str4[] = "test3";
+ char const* str5 = NULL;
+ char const* str6 = "1test1";
+
+ BOOST_TEST( str1 == str2 );
+ BOOST_TEST( str1 == str3 );
+ BOOST_TEST( str3 == str2 );
+ BOOST_TEST( str1 == str4 );
+ BOOST_TEST( str3 == str4 );
+ BOOST_TEST( str1 == str5 );
+
+ BOOST_TEST( str1 != (str6+1) );
+ BOOST_TEST( str5 != str5 );
+
+ BOOST_TEST( str3 < str1 );
+ BOOST_TEST( str1 >= str2 );
+}
+
+//____________________________________________________________________________//
+
+TEST_CASE( test_BOOST_TEST_bitwise )
+{
+ int a = 0xAB;
+ int b = 0x88;
+ short c = 0x8A;
+
+ BOOST_TEST( a == b, tt::bitwise() );
+ BOOST_TEST( c == b, tt::bitwise() );
+}
+
+//____________________________________________________________________________//
+
+int goo()
+{
+ static int i = 0;
+ return i++;
+}
+
+struct copy_counter : boost::noncopyable {
+ static int s_value;
+
+ copy_counter() {}
+ copy_counter( copy_counter const& ) { s_value++; }
+#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
+ copy_counter( copy_counter&& ) {}
+#endif
+};
+
+int copy_counter::s_value = 0;
+
+bool operator==( copy_counter const&, copy_counter const& ) { return true; }
+std::ostream& operator<<( std::ostream& os, copy_counter const& ) { return os << "copy_counter"; }
+
+BOOST_AUTO_TEST_CASE( test_argument_handling )
+{
+ BOOST_TEST( goo() == 0 );
+ BOOST_TEST( goo() == 1 );
+ BOOST_TEST( 2 == goo() );
+ BOOST_TEST( 3 == goo() );
+ BOOST_TEST( goo() != 5 );
+ BOOST_TEST( copy_counter() == copy_counter() );
+#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
+ BOOST_TEST( copy_counter::s_value == 0 );
+#endif
}
//____________________________________________________________________________//
-// !! CHECK_SMALL
+
+#endif
// EOF
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 2013-02-04 03:34:26 EST (Mon, 04 Feb 2013)
@@ -136,6 +136,9 @@
const_string::size_type pos = fn.rfind( "/" );
if( pos != const_string::npos )
fn.trim_left( pos+1 );
+ pos = fn.rfind( "\\" );
+ if( pos != const_string::npos )
+ fn.trim_left( pos+1 );
BOOST_CHECK_EQUAL( fn, const_string( "test_tree_management_test.cpp" ) );
BOOST_CHECK_EQUAL( ts1->p_line_num, 129U );
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