|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r81137 - in trunk/libs/test/test: . test_datasets test_datasets_src test_files
From: gennadiy.rozental_at_[hidden]
Date: 2012-11-01 18:25:58
Author: rogeeff
Date: 2012-11-01 18:25:57 EDT (Thu, 01 Nov 2012)
New Revision: 81137
URL: http://svn.boost.org/trac/boost/changeset/81137
Log:
moved test_dataset sources; BOOST_TEST test case
Added:
trunk/libs/test/test/test_datasets_src/
- copied from r81110, /trunk/libs/test/test/test_datasets/
Removed:
trunk/libs/test/test/test_datasets/
Text files modified:
trunk/libs/test/test/Jamfile.v2 | 2
trunk/libs/test/test/test_datasets_src/test_array.cpp | 16 +++---
trunk/libs/test/test/test_datasets_src/test_case_interface_test.cpp | 22 +++++-----
trunk/libs/test/test/test_datasets_src/test_collection.cpp | 32 +++++++-------
trunk/libs/test/test/test_datasets_src/test_implicit.cpp | 26 +++++------
trunk/libs/test/test/test_datasets_src/test_mono_grid.cpp | 54 ++++++++++++------------
trunk/libs/test/test/test_datasets_src/test_mono_join.cpp | 50 +++++++++++-----------
trunk/libs/test/test/test_datasets_src/test_mono_zip.cpp | 54 ++++++++++++------------
trunk/libs/test/test/test_datasets_src/test_random.cpp | 46 ++++++++++----------
trunk/libs/test/test/test_datasets_src/test_singleton.cpp | 24 +++++-----
trunk/libs/test/test/test_datasets_src/test_xrange.cpp | 42 +++++++++---------
trunk/libs/test/test/test_files/test_tools_test.pattern | 47 +++++++++++----------
trunk/libs/test/test/test_tools_test.cpp | 88 ++++++++++++++++++++++++---------------
13 files changed, 261 insertions(+), 242 deletions(-)
Modified: trunk/libs/test/test/Jamfile.v2
==============================================================================
--- trunk/libs/test/test/Jamfile.v2 (original)
+++ trunk/libs/test/test/Jamfile.v2 2012-11-01 18:25:57 EDT (Thu, 01 Nov 2012)
@@ -85,7 +85,7 @@
[ test-btl-lib run : test_tree_management_test : boost_unit_test_framework ]
[ test-btl-lib run : run_by_name_label_test : boost_unit_test_framework/<link>static ]
[ test-btl-lib run : test_assertion_construction : boost_unit_test_framework/<link>static ]
- [ test-btl-lib run : test_datasets : boost_unit_test_framework/<link>static : : [ glob test_datasets/*.cpp ] ]
+ [ test-btl-lib run : test_datasets : boost_unit_test_framework/<link>static : : [ glob test_datasets_src/*.cpp ] ]
;
test-suite "multithreaded_test"
Modified: trunk/libs/test/test/test_datasets_src/test_array.cpp
==============================================================================
--- /trunk/libs/test/test/test_datasets/test_array.cpp (original)
+++ trunk/libs/test/test/test_datasets_src/test_array.cpp 2012-11-01 18:25:57 EDT (Thu, 01 Nov 2012)
@@ -22,9 +22,9 @@
BOOST_AUTO_TEST_CASE( test_array )
{
int arr1[] = {1,2,3};
- BOOST_CHECKA( data::make( arr1 ).size() == 3 );
+ BOOST_TEST( data::make( arr1 ).size() == 3 );
double const arr2[] = {7.4,3.2};
- BOOST_CHECKA( data::make( arr2 ).size() == 2 );
+ BOOST_TEST( data::make( arr2 ).size() == 2 );
int arr3[] = {7,11,13,17};
int* ptr3 = arr3;
@@ -32,32 +32,32 @@
int c = 0;
data::for_each_sample( data::make( arr3 ), [&c,ptr3](int i) {
- BOOST_CHECKA( i == ptr3[c++] );
+ BOOST_TEST( i == ptr3[c++] );
});
invocation_count ic;
ic.m_value = 0;
data::for_each_sample( data::make( arr3 ), ic );
- BOOST_CHECKA( ic.m_value == 4 );
+ BOOST_TEST( ic.m_value == 4 );
ic.m_value = 0;
data::for_each_sample( data::make( arr3 ), ic, 2 );
- BOOST_CHECKA( ic.m_value == 2 );
+ BOOST_TEST( ic.m_value == 2 );
ic.m_value = 0;
data::for_each_sample( data::make( arr3 ), ic, 0 );
- BOOST_CHECKA( ic.m_value == 0 );
+ BOOST_TEST( ic.m_value == 0 );
copy_count::value() = 0;
copy_count arr4[] = { copy_count(), copy_count() };
data::for_each_sample( data::make( arr4 ), check_arg_type<copy_count>() );
- BOOST_CHECKA( copy_count::value() == 0 );
+ BOOST_TEST( copy_count::value() == 0 );
copy_count::value() = 0;
copy_count const arr5[] = { copy_count(), copy_count() };
data::for_each_sample( data::make( arr5 ), check_arg_type<copy_count>() );
- BOOST_CHECKA( copy_count::value() == 0 );
+ BOOST_TEST( copy_count::value() == 0 );
}
//____________________________________________________________________________//
Modified: trunk/libs/test/test/test_datasets_src/test_case_interface_test.cpp
==============================================================================
--- /trunk/libs/test/test/test_datasets/test_case_interface_test.cpp (original)
+++ trunk/libs/test/test/test_datasets_src/test_case_interface_test.cpp 2012-11-01 18:25:57 EDT (Thu, 01 Nov 2012)
@@ -27,7 +27,7 @@
BOOST_DATA_TEST_CASE( test_case_interface_01, samples1 )
{
- BOOST_CHECKA( sample == samples1[index1++] );
+ BOOST_TEST( sample == samples1[index1++] );
}
//____________________________________________________________________________//
@@ -37,7 +37,7 @@
BOOST_DATA_TEST_CASE( test_case_interface_02, samples2, str )
{
- BOOST_CHECKA( str == samples2[index2++] );
+ BOOST_TEST( str == samples2[index2++] );
}
//____________________________________________________________________________//
@@ -48,9 +48,9 @@
BOOST_DATA_TEST_CASE( test_case_interface_03, data::make(samples1)+samples3, val )
{
if( index3 < 3 )
- BOOST_CHECKA( val == samples1[index3] );
+ BOOST_TEST( val == samples1[index3] );
else
- BOOST_CHECKA( val == samples3[index3-3] );
+ BOOST_TEST( val == samples3[index3-3] );
++index3;
}
@@ -61,8 +61,8 @@
BOOST_DATA_TEST_CASE( test_case_interface_04, data::make(samples2)^samples3, str, intval )
{
- BOOST_CHECKA( str == samples2[index4] );
- BOOST_CHECKA( intval == samples3[index4] );
+ BOOST_TEST( str == samples2[index4] );
+ BOOST_TEST( intval == samples3[index4] );
++index4;
}
@@ -73,8 +73,8 @@
BOOST_DATA_TEST_CASE( test_case_interface_05, data::make(samples1) * samples2, sample0, sample1 )
{
- BOOST_CHECKA( sample0 == samples1[index5/2] );
- BOOST_CHECKA( sample1 == samples2[index5%2] );
+ BOOST_TEST( sample0 == samples1[index5/2] );
+ BOOST_TEST( sample1 == samples2[index5%2] );
++index5;
}
@@ -85,9 +85,9 @@
BOOST_DATA_TEST_CASE( test_case_interface_06, data::make(samples1) * samples2 * samples3, intval, str, val2 )
{
- BOOST_CHECKA( intval == samples1[index6/4] );
- BOOST_CHECKA( str == samples2[(index6/2)%2] );
- BOOST_CHECKA( val2 == samples3[index6%2] );
+ BOOST_TEST( intval == samples1[index6/4] );
+ BOOST_TEST( str == samples2[(index6/2)%2] );
+ BOOST_TEST( val2 == samples3[index6%2] );
++index6;
}
Modified: trunk/libs/test/test/test_datasets_src/test_collection.cpp
==============================================================================
--- /trunk/libs/test/test/test_datasets/test_collection.cpp (original)
+++ trunk/libs/test/test/test_datasets_src/test_collection.cpp 2012-11-01 18:25:57 EDT (Thu, 01 Nov 2012)
@@ -24,10 +24,10 @@
BOOST_AUTO_TEST_CASE( test_collection )
{
- BOOST_CHECKA( data::make( std::vector<int>() ).size() == 0 );
- BOOST_CHECKA( data::make( std::vector<int>( 3 ) ).size() == 3 );
- BOOST_CHECKA( data::make( std::list<double>() ).size() == 0 );
- BOOST_CHECKA( data::make( std::list<double>( 2 ) ).size() == 2 );
+ BOOST_TEST( data::make( std::vector<int>() ).size() == 0 );
+ BOOST_TEST( data::make( std::vector<int>( 3 ) ).size() == 3 );
+ BOOST_TEST( data::make( std::list<double>() ).size() == 0 );
+ BOOST_TEST( data::make( std::list<double>( 2 ) ).size() == 2 );
data::for_each_sample( data::make( std::vector<int>( 3 ) ), check_arg_type<int>() );
data::for_each_sample( data::make( std::list<double>( 2 ) ), check_arg_type<double>() );
@@ -36,15 +36,15 @@
ic.m_value = 0;
data::for_each_sample( data::make( std::vector<int>( 3 ) ), ic );
- BOOST_CHECKA( ic.m_value == 3 );
+ BOOST_TEST( ic.m_value == 3 );
ic.m_value = 0;
data::for_each_sample( data::make( std::list<double>( 2 ) ), ic, 4 );
- BOOST_CHECKA( ic.m_value == 2 );
+ BOOST_TEST( ic.m_value == 2 );
ic.m_value = 0;
data::for_each_sample( data::make( std::vector<int>( 3 ) ), ic, 1 );
- BOOST_CHECKA( ic.m_value == 1 );
+ BOOST_TEST( ic.m_value == 1 );
std::vector<int> samples1;
samples1.push_back(5);
@@ -53,7 +53,7 @@
int c = 0;
data::for_each_sample( data::make( samples1 ), [&c,samples1](int i) {
- BOOST_CHECKA( i == samples1[c++] );
+ BOOST_TEST( i == samples1[c++] );
});
std::list<char const*> samples2;
@@ -63,34 +63,34 @@
auto it = samples2.begin();
data::for_each_sample( data::make( samples2 ), [&it](char const* str ) {
- BOOST_CHECKA( str == *it++ );
+ BOOST_TEST( str == *it++ );
});
copy_count::value() = 0;
data::for_each_sample( data::make( std::vector<copy_count>( 2 ) ), check_arg_type<copy_count>() );
- BOOST_CHECKA( copy_count::value() == 0 );
+ BOOST_TEST( copy_count::value() == 0 );
copy_count::value() = 0;
std::vector<copy_count> samples3( 2 );
data::for_each_sample( data::make( samples3 ), check_arg_type<copy_count>() );
- BOOST_CHECKA( copy_count::value() == 0 );
+ BOOST_TEST( copy_count::value() == 0 );
copy_count::value() = 0;
std::vector<copy_count> const samples4( 2 );
data::for_each_sample( data::make( samples4 ), check_arg_type<copy_count>() );
- BOOST_CHECKA( copy_count::value() == 0 );
+ BOOST_TEST( copy_count::value() == 0 );
copy_count::value() = 0;
auto ds1 = data::make( make_copy_count_collection() );
- BOOST_CHECKA( ds1.size() == 3 );
+ BOOST_TEST( ds1.size() == 3 );
data::for_each_sample( ds1, check_arg_type<copy_count>() );
- BOOST_CHECKA( copy_count::value() == 0 );
+ BOOST_TEST( copy_count::value() == 0 );
copy_count::value() = 0;
auto ds2 = data::make( make_copy_count_const_collection() );
- BOOST_CHECKA( ds2.size() == 3 );
+ BOOST_TEST( ds2.size() == 3 );
data::for_each_sample( ds2, check_arg_type<copy_count>() );
- BOOST_CHECKA( copy_count::value() == 3 ); // !! ?? no const rvalue rev constructor for std::list
+ BOOST_TEST( copy_count::value() == 3 ); // !! ?? no const rvalue rev constructor for std::list
}
//____________________________________________________________________________//
Modified: trunk/libs/test/test/test_datasets_src/test_implicit.cpp
==============================================================================
--- /trunk/libs/test/test/test_datasets/test_implicit.cpp (original)
+++ trunk/libs/test/test/test_datasets_src/test_implicit.cpp 2012-11-01 18:25:57 EDT (Thu, 01 Nov 2012)
@@ -37,35 +37,33 @@
ic.m_value = 0;
data::for_each_sample( std::vector<int>( 3 ), ic );
- BOOST_CHECKA( ic.m_value == 3 );
+ BOOST_TEST( ic.m_value == 3 );
ic.m_value = 0;
data::for_each_sample( std::list<double>( 2 ), ic, 1 );
- BOOST_CHECKA( ic.m_value == 1 );
+ BOOST_TEST( ic.m_value == 1 );
copy_count::value() = 0;
std::vector<copy_count> samples1( 2 );
data::for_each_sample( samples1, check_arg_type<copy_count>() );
- BOOST_CHECKA( copy_count::value() == 0 );
+ BOOST_TEST( copy_count::value() == 0 );
copy_count::value() = 0;
copy_count samples2[] = { copy_count(), copy_count() };
data::for_each_sample( samples2, check_arg_type<copy_count>() );
- BOOST_CHECKA( copy_count::value() == 0 );
+ BOOST_TEST( copy_count::value() == 0 );
}
//____________________________________________________________________________//
BOOST_AUTO_TEST_CASE( test_implicit_join )
{
-#if 0
auto ds = data::make( 5 );
- BOOST_CHECKA( (1 + ds).size() == 2 );
- BOOST_CHECKA( (ds + 1).size() == 2 );
+ BOOST_TEST( (1 + ds).size() == 2 );
+ BOOST_TEST( (ds + 1).size() == 2 );
- BOOST_CHECKA( (1 + data::make( 5 )).size() == 2 );
- BOOST_CHECKA( (data::make( 5 ) + 1).size() == 2 );
-#endif
+ BOOST_TEST( (1 + data::make( 5 )).size() == 2 );
+ BOOST_TEST( (data::make( 5 ) + 1).size() == 2 );
}
//____________________________________________________________________________//
@@ -73,11 +71,11 @@
BOOST_AUTO_TEST_CASE( test_implicit_zip )
{
auto ds = data::make( 5 );
- BOOST_CHECKA( (1 ^ ds).size() == 1 );
- BOOST_CHECKA( (ds ^ 1).size() == 1 );
+ BOOST_TEST( (1 ^ ds).size() == 1 );
+ BOOST_TEST( (ds ^ 1).size() == 1 );
- BOOST_CHECKA( (1 ^ data::make( 5 )).size() == 1 );
- BOOST_CHECKA( (data::make( 5 ) ^ 1).size() == 1 );
+ BOOST_TEST( (1 ^ data::make( 5 )).size() == 1 );
+ BOOST_TEST( (data::make( 5 ) ^ 1).size() == 1 );
}
//____________________________________________________________________________//
Modified: trunk/libs/test/test/test_datasets_src/test_mono_grid.cpp
==============================================================================
--- /trunk/libs/test/test/test_datasets/test_mono_grid.cpp (original)
+++ trunk/libs/test/test/test_datasets_src/test_mono_grid.cpp 2012-11-01 18:25:57 EDT (Thu, 01 Nov 2012)
@@ -24,13 +24,13 @@
BOOST_AUTO_TEST_CASE( test_mono_grid )
{
- BOOST_CHECKA( (data::make( 1 ) * data::make( 5 )).size() == 1 );
- BOOST_CHECKA( (data::make( std::vector<int>(2) ) * data::make( std::list<float>(2) )).size() == 4 );
- BOOST_CHECKA( (data::make( std::vector<int>(2) ) * data::make( 5. )).size() == 2 );
- BOOST_CHECKA( (data::make( std::vector<int>(3) ) * data::make( std::list<int>(1) )).size() == 3 );
+ BOOST_TEST( (data::make( 1 ) * data::make( 5 )).size() == 1 );
+ BOOST_TEST( (data::make( std::vector<int>(2) ) * data::make( std::list<float>(2) )).size() == 4 );
+ BOOST_TEST( (data::make( std::vector<int>(2) ) * data::make( 5. )).size() == 2 );
+ BOOST_TEST( (data::make( std::vector<int>(3) ) * data::make( std::list<int>(1) )).size() == 3 );
- BOOST_CHECKA( (data::make( std::vector<int>(3) ) * data::make( std::list<std::string>(3) ) * data::make( 5 )).size() == 9 );
- BOOST_CHECKA( (data::make( std::vector<int>(1) ) * data::make( std::list<int>(3) ) * data::make( 5 )).size() == 3 );
+ BOOST_TEST( (data::make( std::vector<int>(3) ) * data::make( std::list<std::string>(3) ) * data::make( 5 )).size() == 9 );
+ BOOST_TEST( (data::make( std::vector<int>(1) ) * data::make( std::list<int>(3) ) * data::make( 5 )).size() == 3 );
int arr1[] = {1,2};
@@ -42,18 +42,18 @@
auto samples1 = data::make( arr1 ) * data::make( arr2 );
- BOOST_CHECKA( samples1.size() == 4 );
+ BOOST_TEST( samples1.size() == 4 );
ic.m_value = 0;
data::for_each_sample( samples1, ic );
- BOOST_CHECKA( ic.m_value == 4 );
+ BOOST_TEST( ic.m_value == 4 );
data::for_each_sample( samples1, check_arg_type_like<std::tuple<int,char const*>>() );
c = 0;
data::for_each_sample( samples1, [&c,exp1,exp2](int i,char const* s) {
- BOOST_CHECKA( i == exp1[c/2] );
- BOOST_CHECKA( s == exp2[c%2] );
+ BOOST_TEST( i == exp1[c/2] );
+ BOOST_TEST( s == exp2[c%2] );
++c;
});
@@ -65,11 +65,11 @@
auto samples2 = data::make( vec1 ) * data::make( "qqq" ) * data::make( arr3 );
- BOOST_CHECKA( samples2.size() == 9 );
+ BOOST_TEST( samples2.size() == 9 );
ic.m_value = 0;
data::for_each_sample( samples2, ic );
- BOOST_CHECKA( ic.m_value == 9 );
+ BOOST_TEST( ic.m_value == 9 );
data::for_each_sample( samples2, check_arg_type_like<std::tuple<double,char const*,int>>() );
@@ -77,65 +77,65 @@
int* exp3 = arr3;
data::for_each_sample( samples2, [&c,&vec1,exp3](double a1,char const* a2,int a3) {
- BOOST_CHECKA( a1 == vec1[c/3] );
+ BOOST_TEST( a1 == vec1[c/3] );
BOOST_CHECK_EQUAL( a2, "qqq" );
- BOOST_CHECKA( a3 == exp3[c%3] );
+ BOOST_TEST( a3 == exp3[c%3] );
++c;
});
copy_count::value() = 0;
data::for_each_sample( data::make( copy_count() ) * data::make( copy_count() ), check_arg_type<std::tuple<copy_count,copy_count>>() );
- BOOST_CHECKA( copy_count::value() == 0 );
+ BOOST_TEST( copy_count::value() == 0 );
copy_count::value() = 0;
data::for_each_sample( data::make( copy_count() ) * data::make( copy_count() ) * data::make( copy_count() ),
check_arg_type<std::tuple<copy_count,copy_count,copy_count>>() );
- BOOST_CHECKA( copy_count::value() == 0 );
+ BOOST_TEST( copy_count::value() == 0 );
copy_count::value() = 0;
data::for_each_sample( data::make( copy_count() ) * (data::make( copy_count() ) * data::make( copy_count() )),
check_arg_type<std::tuple<copy_count,copy_count,copy_count>>() );
- BOOST_CHECKA( copy_count::value() == 0 );
+ BOOST_TEST( copy_count::value() == 0 );
auto ds1 = data::make( copy_count() );
auto const ds2 = data::make( copy_count() );
copy_count::value() = 0;
data::for_each_sample( ds1 * ds1, check_arg_type<std::tuple<copy_count,copy_count>>() );
- BOOST_CHECKA( copy_count::value() == 0 );
+ BOOST_TEST( copy_count::value() == 0 );
copy_count::value() = 0;
data::for_each_sample( ds2 * ds2, check_arg_type<std::tuple<copy_count,copy_count>>() );
- BOOST_CHECKA( copy_count::value() == 0 );
+ BOOST_TEST( copy_count::value() == 0 );
copy_count::value() = 0;
data::for_each_sample( ds1 * ds2, check_arg_type<std::tuple<copy_count,copy_count>>() );
- BOOST_CHECKA( copy_count::value() == 0 );
+ BOOST_TEST( copy_count::value() == 0 );
copy_count::value() = 0;
auto zp1 = ds1 * data::make( copy_count() );
- BOOST_CHECKA( zp1.size() == 1 );
+ BOOST_TEST( zp1.size() == 1 );
data::for_each_sample( zp1, check_arg_type<std::tuple<copy_count,copy_count>>() );
- BOOST_CHECKA( copy_count::value() == 0 );
+ BOOST_TEST( copy_count::value() == 0 );
copy_count::value() = 0;
data::for_each_sample( data::make( copy_count() ) * ds1, check_arg_type<std::tuple<copy_count,copy_count>>() );
- BOOST_CHECKA( copy_count::value() == 0 );
+ BOOST_TEST( copy_count::value() == 0 );
copy_count::value() = 0;
data::for_each_sample( ds1 * ds2 * ds1, check_arg_type<std::tuple<copy_count,copy_count,copy_count>>() );
- BOOST_CHECKA( copy_count::value() == 0 );
+ BOOST_TEST( copy_count::value() == 0 );
copy_count::value() = 0;
data::for_each_sample( ds1 * (ds1 * ds2), check_arg_type<std::tuple<copy_count,copy_count,copy_count>>() );
- BOOST_CHECKA( copy_count::value() == 0 );
+ BOOST_TEST( copy_count::value() == 0 );
copy_count::value() = 0;
auto ds3 = data::make( make_copy_count_collection() ) * data::make( make_copy_count_collection() );
- BOOST_CHECKA( ds3.size() == 9 );
+ BOOST_TEST( ds3.size() == 9 );
data::for_each_sample( ds3, check_arg_type<std::tuple<copy_count,copy_count>>() );
- BOOST_CHECKA( copy_count::value() == 0 );
+ BOOST_TEST( copy_count::value() == 0 );
}
//____________________________________________________________________________//
Modified: trunk/libs/test/test/test_datasets_src/test_mono_join.cpp
==============================================================================
--- /trunk/libs/test/test/test_datasets/test_mono_join.cpp (original)
+++ trunk/libs/test/test/test_datasets_src/test_mono_join.cpp 2012-11-01 18:25:57 EDT (Thu, 01 Nov 2012)
@@ -24,16 +24,16 @@
BOOST_AUTO_TEST_CASE( test_mono_join )
{
- BOOST_CHECKA( (data::make( 1 ) + data::make( 5 )).size() == 2 );
- BOOST_CHECKA( (data::make( std::vector<int>(2) ) + data::make( std::list<int>(3) )).size() == 5 );
+ BOOST_TEST( (data::make( 1 ) + data::make( 5 )).size() == 2 );
+ BOOST_TEST( (data::make( std::vector<int>(2) ) + data::make( std::list<int>(3) )).size() == 5 );
int arr1[] = {1,2};
int arr2[] = {7,19};
- BOOST_CHECKA( (data::make( arr1 ) + data::make( arr2 )).size() == 4 );
+ BOOST_TEST( (data::make( arr1 ) + data::make( arr2 )).size() == 4 );
- BOOST_CHECKA( (data::make( 1 ) + data::make( 5 ) + data::make( 19 )).size() == 3 );
+ BOOST_TEST( (data::make( 1 ) + data::make( 5 ) + data::make( 19 )).size() == 3 );
- BOOST_CHECKA( (data::make( std::vector<int>(2) ) + data::make( 1 ) + data::make( arr2 ) + data::make( 17 )).size() == 6 );
+ BOOST_TEST( (data::make( std::vector<int>(2) ) + data::make( 1 ) + data::make( arr2 ) + data::make( 17 )).size() == 6 );
int expected[] = {1,2,5,7,19,37};
int* exp = expected;
@@ -44,93 +44,93 @@
ic.m_value = 0;
data::for_each_sample( samples1, ic );
- BOOST_CHECKA( ic.m_value == 6 );
+ BOOST_TEST( ic.m_value == 6 );
c = 0;
data::for_each_sample( samples1, [&c,exp](int i) {
- BOOST_CHECKA( i == exp[c++] );
+ BOOST_TEST( i == exp[c++] );
});
auto samples2 = data::make( std::vector<int>(arr1,arr1+2) ) + (data::make( 5 ) + (data::make( arr2 ) + data::make( 37 )));
ic.m_value = 0;
data::for_each_sample( samples2, ic );
- BOOST_CHECKA( ic.m_value == 6 );
+ BOOST_TEST( ic.m_value == 6 );
c = 0;
data::for_each_sample( samples2, [&c,exp](int i) {
- BOOST_CHECKA( i == exp[c++] );
+ BOOST_TEST( i == exp[c++] );
});
auto samples3 = (data::make( std::vector<int>(arr1,arr1+2) ) + data::make( 5 )) + (data::make( arr2 ) + data::make( 37 ));
ic.m_value = 0;
data::for_each_sample( samples3, ic );
- BOOST_CHECKA( ic.m_value == 6 );
+ BOOST_TEST( ic.m_value == 6 );
c = 0;
data::for_each_sample( samples3, [&c,exp](int i) {
- BOOST_CHECKA( i == exp[c++] );
+ BOOST_TEST( i == exp[c++] );
});
copy_count::value() = 0;
data::for_each_sample( data::make( copy_count() ) + data::make( copy_count() ), check_arg_type<copy_count>() );
- BOOST_CHECKA( copy_count::value() == 0 );
+ BOOST_TEST( copy_count::value() == 0 );
copy_count::value() = 0;
data::for_each_sample( data::make( copy_count() ) + data::make( copy_count() ) + data::make( copy_count() ), check_arg_type<copy_count>() );
- BOOST_CHECKA( copy_count::value() == 0 );
+ BOOST_TEST( copy_count::value() == 0 );
copy_count::value() = 0;
data::for_each_sample( data::make( copy_count() ) + (data::make( copy_count() ) + data::make( copy_count() )), check_arg_type<copy_count>() );
- BOOST_CHECKA( copy_count::value() == 0 );
+ BOOST_TEST( copy_count::value() == 0 );
copy_count::value() = 0;
data::for_each_sample( (data::make( copy_count() ) + data::make( copy_count() )) +
(data::make( copy_count() ) + data::make( copy_count() )), check_arg_type<copy_count>() );
- BOOST_CHECKA( copy_count::value() == 0 );
+ BOOST_TEST( copy_count::value() == 0 );
auto ds1 = data::make( copy_count() );
auto const ds2 = data::make( copy_count() );
copy_count::value() = 0;
data::for_each_sample( ds1 + ds1, check_arg_type<copy_count>() );
- BOOST_CHECKA( copy_count::value() == 0 );
+ BOOST_TEST( copy_count::value() == 0 );
copy_count::value() = 0;
data::for_each_sample( ds2 + ds2, check_arg_type<copy_count>() );
- BOOST_CHECKA( copy_count::value() == 0 );
+ BOOST_TEST( copy_count::value() == 0 );
copy_count::value() = 0;
data::for_each_sample( ds1 + ds2, check_arg_type<copy_count>() );
- BOOST_CHECKA( copy_count::value() == 0 );
+ BOOST_TEST( copy_count::value() == 0 );
copy_count::value() = 0;
auto jn1 = ds1 + data::make( copy_count() );
data::for_each_sample( jn1, check_arg_type<copy_count>() );
- BOOST_CHECKA( copy_count::value() == 0 );
+ BOOST_TEST( copy_count::value() == 0 );
copy_count::value() = 0;
data::for_each_sample( data::make( copy_count() ) + ds1, check_arg_type<copy_count>() );
- BOOST_CHECKA( copy_count::value() == 0 );
+ BOOST_TEST( copy_count::value() == 0 );
copy_count::value() = 0;
data::for_each_sample( ds1 + ds2 + ds1, check_arg_type<copy_count>() );
- BOOST_CHECKA( copy_count::value() == 0 );
+ BOOST_TEST( copy_count::value() == 0 );
copy_count::value() = 0;
data::for_each_sample( ds1 + (ds1 + ds2), check_arg_type<copy_count>() );
- BOOST_CHECKA( copy_count::value() == 0 );
+ BOOST_TEST( copy_count::value() == 0 );
copy_count::value() = 0;
data::for_each_sample( (ds1 + ds1) + (ds2 + ds2), check_arg_type<copy_count>() );
- BOOST_CHECKA( copy_count::value() == 0 );
+ BOOST_TEST( copy_count::value() == 0 );
copy_count::value() = 0;
auto ds3 = data::make( make_copy_count_collection() ) + data::make( make_copy_count_collection() );
- BOOST_CHECKA( ds3.size() == 6 );
+ BOOST_TEST( ds3.size() == 6 );
data::for_each_sample( ds3, check_arg_type<copy_count>() );
- BOOST_CHECKA( copy_count::value() == 0 );
+ BOOST_TEST( copy_count::value() == 0 );
}
//____________________________________________________________________________//
Modified: trunk/libs/test/test/test_datasets_src/test_mono_zip.cpp
==============================================================================
--- /trunk/libs/test/test/test_datasets/test_mono_zip.cpp (original)
+++ trunk/libs/test/test/test_datasets_src/test_mono_zip.cpp 2012-11-01 18:25:57 EDT (Thu, 01 Nov 2012)
@@ -24,13 +24,13 @@
BOOST_AUTO_TEST_CASE( test_mono_zip )
{
- BOOST_CHECKA( (data::make( 1 ) ^ data::make( 5 )).size() == 1 );
- BOOST_CHECKA( (data::make( std::vector<int>(2) ) ^ data::make( std::list<float>(2) )).size() == 2 );
- BOOST_CHECKA( (data::make( std::vector<int>(2) ) ^ data::make( 5. )).size() == 2 );
- BOOST_CHECKA( (data::make( std::vector<int>(3) ) ^ data::make( std::list<int>(1) )).size() == 3 );
+ BOOST_TEST( (data::make( 1 ) ^ data::make( 5 )).size() == 1 );
+ BOOST_TEST( (data::make( std::vector<int>(2) ) ^ data::make( std::list<float>(2) )).size() == 2 );
+ BOOST_TEST( (data::make( std::vector<int>(2) ) ^ data::make( 5. )).size() == 2 );
+ BOOST_TEST( (data::make( std::vector<int>(3) ) ^ data::make( std::list<int>(1) )).size() == 3 );
- BOOST_CHECKA( (data::make( std::vector<int>(3) ) ^ data::make( std::list<std::string>(3) ) ^ data::make( 5 )).size() == 3 );
- BOOST_CHECKA( (data::make( std::vector<int>(1) ) ^ data::make( std::list<int>(3) ) ^ data::make( 5 )).size() == 3 );
+ BOOST_TEST( (data::make( std::vector<int>(3) ) ^ data::make( std::list<std::string>(3) ) ^ data::make( 5 )).size() == 3 );
+ BOOST_TEST( (data::make( std::vector<int>(1) ) ^ data::make( std::list<int>(3) ) ^ data::make( 5 )).size() == 3 );
int arr1[] = {1,2};
char const* arr2[] = {"a","b"};
@@ -41,18 +41,18 @@
auto samples1 = data::make( arr1 ) ^ data::make( arr2 );
- BOOST_CHECKA( samples1.size() == 2 );
+ BOOST_TEST( samples1.size() == 2 );
ic.m_value = 0;
data::for_each_sample( samples1, ic );
- BOOST_CHECKA( ic.m_value == 2 );
+ BOOST_TEST( ic.m_value == 2 );
data::for_each_sample( samples1, check_arg_type_like<std::tuple<int,char const*>>() );
c = 0;
data::for_each_sample( samples1, [&c,exp1,exp2](int i,char const* s) {
- BOOST_CHECKA( i == exp1[c] );
- BOOST_CHECKA( s == exp2[c] );
+ BOOST_TEST( i == exp1[c] );
+ BOOST_TEST( s == exp2[c] );
++c;
});
@@ -64,11 +64,11 @@
auto samples2 = data::make( vec1 ) ^ data::make( "qqq" ) ^ data::make( arr3 );
- BOOST_CHECKA( samples2.size() == 3 );
+ BOOST_TEST( samples2.size() == 3 );
ic.m_value = 0;
data::for_each_sample( samples2, ic );
- BOOST_CHECKA( ic.m_value == 3 );
+ BOOST_TEST( ic.m_value == 3 );
data::for_each_sample( samples2, check_arg_type_like<std::tuple<double,char const*,int>>() );
@@ -76,64 +76,64 @@
int* exp3 = arr3;
data::for_each_sample( samples2, [&c,&vec1,exp3](double a1,char const* a2,int a3) {
- BOOST_CHECKA( a1 == vec1[c] );
+ BOOST_TEST( a1 == vec1[c] );
BOOST_CHECK_EQUAL( a2, "qqq" );
- BOOST_CHECKA( a3 == exp3[c] );
+ BOOST_TEST( a3 == exp3[c] );
++c;
});
copy_count::value() = 0;
data::for_each_sample( data::make( copy_count() ) ^ data::make( copy_count() ), check_arg_type<std::tuple<copy_count,copy_count>>() );
- BOOST_CHECKA( copy_count::value() == 0 );
+ BOOST_TEST( copy_count::value() == 0 );
copy_count::value() = 0;
data::for_each_sample( data::make( copy_count() ) ^ data::make( copy_count() ) ^ data::make( copy_count() ),
check_arg_type<std::tuple<copy_count,copy_count,copy_count>>() );
- BOOST_CHECKA( copy_count::value() == 0 );
+ BOOST_TEST( copy_count::value() == 0 );
copy_count::value() = 0;
data::for_each_sample( data::make( copy_count() ) ^ (data::make( copy_count() ) ^ data::make( copy_count() )),
check_arg_type<std::tuple<copy_count,copy_count,copy_count>>() );
- BOOST_CHECKA( copy_count::value() == 0 );
+ BOOST_TEST( copy_count::value() == 0 );
auto ds1 = data::make( copy_count() );
auto const ds2 = data::make( copy_count() );
copy_count::value() = 0;
data::for_each_sample( ds1 ^ ds1, check_arg_type<std::tuple<copy_count,copy_count>>() );
- BOOST_CHECKA( copy_count::value() == 0 );
+ BOOST_TEST( copy_count::value() == 0 );
copy_count::value() = 0;
data::for_each_sample( ds2 ^ ds2, check_arg_type<std::tuple<copy_count,copy_count>>() );
- BOOST_CHECKA( copy_count::value() == 0 );
+ BOOST_TEST( copy_count::value() == 0 );
copy_count::value() = 0;
data::for_each_sample( ds1 ^ ds2, check_arg_type<std::tuple<copy_count,copy_count>>() );
- BOOST_CHECKA( copy_count::value() == 0 );
+ BOOST_TEST( copy_count::value() == 0 );
copy_count::value() = 0;
auto zp1 = ds1 ^ data::make( copy_count() );
- BOOST_CHECKA( zp1.size() == 1 );
+ BOOST_TEST( zp1.size() == 1 );
data::for_each_sample( zp1, check_arg_type<std::tuple<copy_count,copy_count>>() );
- BOOST_CHECKA( copy_count::value() == 0 );
+ BOOST_TEST( copy_count::value() == 0 );
copy_count::value() = 0;
data::for_each_sample( data::make( copy_count() ) ^ ds1, check_arg_type<std::tuple<copy_count,copy_count>>() );
- BOOST_CHECKA( copy_count::value() == 0 );
+ BOOST_TEST( copy_count::value() == 0 );
copy_count::value() = 0;
data::for_each_sample( ds1 ^ ds2 ^ ds1, check_arg_type<std::tuple<copy_count,copy_count,copy_count>>() );
- BOOST_CHECKA( copy_count::value() == 0 );
+ BOOST_TEST( copy_count::value() == 0 );
copy_count::value() = 0;
data::for_each_sample( ds1 ^ (ds1 ^ ds2), check_arg_type<std::tuple<copy_count,copy_count,copy_count>>() );
- BOOST_CHECKA( copy_count::value() == 0 );
+ BOOST_TEST( copy_count::value() == 0 );
copy_count::value() = 0;
auto ds3 = data::make( make_copy_count_collection() ) ^ data::make( make_copy_count_collection() );
- BOOST_CHECKA( ds3.size() == 3 );
+ BOOST_TEST( ds3.size() == 3 );
data::for_each_sample( ds3, check_arg_type<std::tuple<copy_count,copy_count>>() );
- BOOST_CHECKA( copy_count::value() == 0 );
+ BOOST_TEST( copy_count::value() == 0 );
}
//____________________________________________________________________________//
Modified: trunk/libs/test/test/test_datasets_src/test_random.cpp
==============================================================================
--- /trunk/libs/test/test/test_datasets/test_random.cpp (original)
+++ trunk/libs/test/test/test_datasets_src/test_random.cpp 2012-11-01 18:25:57 EDT (Thu, 01 Nov 2012)
@@ -26,7 +26,7 @@
BOOST_AUTO_TEST_CASE( test_default )
{
- BOOST_CHECKA( data::random().size() == data::BOOST_TEST_DS_INFINITE_SIZE );
+ BOOST_TEST( data::random().size() == data::BOOST_TEST_DS_INFINITE_SIZE );
auto ds = data::random();
@@ -36,12 +36,12 @@
ic.m_value = 0;
data::for_each_sample( ds, ic, 10 );
- BOOST_CHECKA( ic.m_value == 10 );
+ BOOST_TEST( ic.m_value == 10 );
ic.m_value = 0;
int arr[] = {1,2,3,4,5};
data::for_each_sample( ds^arr, ic );
- BOOST_CHECKA( ic.m_value == 5 );
+ BOOST_TEST( ic.m_value == 5 );
BOOST_CHECK_THROW( ds * arr, std::logic_error );
BOOST_CHECK_THROW( arr * ds, std::logic_error );
@@ -54,15 +54,15 @@
auto ds1 = data::random(1,5);
data::for_each_sample( ds1, [](int s) {
- BOOST_CHECKA(s>=1);
- BOOST_CHECKA(s<=5);
+ BOOST_TEST(s>=1);
+ BOOST_TEST(s<=5);
}, 10);
auto ds2 = data::random(1.,2.);
data::for_each_sample( ds2, [](double s) {
- BOOST_CHECKA(s>=1.);
- BOOST_CHECKA(s<=2.);
+ BOOST_TEST(s>=1.);
+ BOOST_TEST(s<=2.);
}, 100);
}
@@ -73,37 +73,37 @@
auto ds1 = data::random(data::distribution = std::normal_distribution<>(5.,2));
typedef decltype(ds1) DS1;
- BOOST_CHECKA(( std::is_same<DS1::generator_type::distr_type,
+ BOOST_TEST(( std::is_same<DS1::generator_type::distr_type,
std::normal_distribution<>>::value ));
- BOOST_CHECKA(( std::is_same<DS1::generator_type::data_type,double>::value ));
- BOOST_CHECKA(( std::is_same<DS1::generator_type::engine_type,
+ BOOST_TEST(( std::is_same<DS1::generator_type::data_type,double>::value ));
+ BOOST_TEST(( std::is_same<DS1::generator_type::engine_type,
std::default_random_engine>::value ));
auto ds2 = data::random(data::distribution = std::discrete_distribution<>());
typedef decltype(ds2) DS2;
- BOOST_CHECKA(( std::is_same<DS2::generator_type::distr_type,
+ BOOST_TEST(( std::is_same<DS2::generator_type::distr_type,
std::discrete_distribution<>>::value ));
- BOOST_CHECKA(( std::is_same<DS2::generator_type::data_type,int>::value ));
- BOOST_CHECKA(( std::is_same<DS2::generator_type::engine_type,
+ BOOST_TEST(( std::is_same<DS2::generator_type::data_type,int>::value ));
+ BOOST_TEST(( std::is_same<DS2::generator_type::engine_type,
std::default_random_engine>::value ));
auto ds3 = data::random(data::engine = std::minstd_rand());
typedef decltype(ds3) DS3;
- BOOST_CHECKA(( std::is_same<DS3::generator_type::distr_type,
+ BOOST_TEST(( std::is_same<DS3::generator_type::distr_type,
std::uniform_real_distribution<>>::value ));
- BOOST_CHECKA(( std::is_same<DS3::generator_type::data_type,double>::value ));
- BOOST_CHECKA(( std::is_same<DS3::generator_type::engine_type,
+ BOOST_TEST(( std::is_same<DS3::generator_type::data_type,double>::value ));
+ BOOST_TEST(( std::is_same<DS3::generator_type::engine_type,
std::minstd_rand>::value ));
auto ds4 = data::random(data::seed = 100UL);
typedef decltype(ds4) DS4;
- BOOST_CHECKA(( std::is_same<DS4::generator_type::distr_type,
+ BOOST_TEST(( std::is_same<DS4::generator_type::distr_type,
std::uniform_real_distribution<>>::value ));
- BOOST_CHECKA(( std::is_same<DS4::generator_type::data_type,double>::value ));
- BOOST_CHECKA(( std::is_same<DS4::generator_type::engine_type,
+ BOOST_TEST(( std::is_same<DS4::generator_type::data_type,double>::value ));
+ BOOST_TEST(( std::is_same<DS4::generator_type::engine_type,
std::default_random_engine>::value ));
auto ds5 = data::random(data::seed = 100UL);
@@ -113,7 +113,7 @@
vals.push_back( s );
}, 10);
data::for_each_sample( ds5, [&vals](double s) {
- BOOST_CHECKA( vals.front() == s );
+ BOOST_TEST( vals.front() == s );
vals.pop_front();
}, 10);
@@ -122,10 +122,10 @@
data::seed = 20UL ));
typedef decltype(ds6) DS6;
- BOOST_CHECKA(( std::is_same<DS6::generator_type::distr_type,
+ BOOST_TEST(( std::is_same<DS6::generator_type::distr_type,
std::normal_distribution<>>::value ));
- BOOST_CHECKA(( std::is_same<DS6::generator_type::data_type,double>::value ));
- BOOST_CHECKA(( std::is_same<DS6::generator_type::engine_type,
+ BOOST_TEST(( std::is_same<DS6::generator_type::data_type,double>::value ));
+ BOOST_TEST(( std::is_same<DS6::generator_type::engine_type,
std::minstd_rand>::value ));
}
Modified: trunk/libs/test/test/test_datasets_src/test_singleton.cpp
==============================================================================
--- /trunk/libs/test/test/test_datasets/test_singleton.cpp (original)
+++ trunk/libs/test/test/test_datasets_src/test_singleton.cpp 2012-11-01 18:25:57 EDT (Thu, 01 Nov 2012)
@@ -24,9 +24,9 @@
BOOST_AUTO_TEST_CASE( test_singleton )
{
- BOOST_CHECKA( data::make( 1 ).size() == 1 );
- BOOST_CHECKA( data::make( 2.3 ).size() == 1 );
- BOOST_CHECKA( data::make( "1" ).size() == 1 );
+ BOOST_TEST( data::make( 1 ).size() == 1 );
+ BOOST_TEST( data::make( 2.3 ).size() == 1 );
+ BOOST_TEST( data::make( "1" ).size() == 1 );
data::for_each_sample( data::make( 2 ), check_arg_type<int>() );
data::for_each_sample( data::make( "ch" ), check_arg_type<char const*>() );
@@ -36,43 +36,43 @@
ic.m_value = 0;
data::for_each_sample( data::make( 2 ), ic );
- BOOST_CHECKA( ic.m_value == 1 );
+ BOOST_TEST( ic.m_value == 1 );
ic.m_value = 0;
data::for_each_sample( data::make( 2 ), ic, 2 );
- BOOST_CHECKA( ic.m_value == 1 );
+ BOOST_TEST( ic.m_value == 1 );
ic.m_value = 0;
data::for_each_sample( data::make( 2 ), ic, 0 );
- BOOST_CHECKA( ic.m_value == 0 );
+ BOOST_TEST( ic.m_value == 0 );
data::for_each_sample( data::make( 2 ), [] (int s) {
- BOOST_CHECKA( s == 2 );
+ BOOST_TEST( s == 2 );
});
copy_count::value() = 0;
data::for_each_sample( data::make( copy_count() ), check_arg_type<copy_count>() );
- BOOST_CHECKA( copy_count::value() == 0 );
+ BOOST_TEST( copy_count::value() == 0 );
copy_count::value() = 0;
copy_count cc1;
data::for_each_sample( data::make( cc1 ), check_arg_type<copy_count>() );
- BOOST_CHECKA( copy_count::value() == 0 );
+ BOOST_TEST( copy_count::value() == 0 );
copy_count::value() = 0;
copy_count const cc2;
data::for_each_sample( data::make( cc2 ), check_arg_type<copy_count>() );
- BOOST_CHECKA( copy_count::value() == 0 );
+ BOOST_TEST( copy_count::value() == 0 );
copy_count::value() = 0;
auto ds1 = data::make( copy_count::make() );
data::for_each_sample( ds1, check_arg_type<copy_count>() );
- BOOST_CHECKA( copy_count::value() == 0 );
+ BOOST_TEST( copy_count::value() == 0 );
copy_count::value() = 0;
auto ds2 = data::make( copy_count::make_const() );
data::for_each_sample( ds2, check_arg_type<copy_count>() );
- BOOST_CHECKA( copy_count::value() == 0 );
+ BOOST_TEST( copy_count::value() == 0 );
}
//____________________________________________________________________________//
Modified: trunk/libs/test/test/test_datasets_src/test_xrange.cpp
==============================================================================
--- /trunk/libs/test/test/test_datasets/test_xrange.cpp (original)
+++ trunk/libs/test/test/test_datasets_src/test_xrange.cpp 2012-11-01 18:25:57 EDT (Thu, 01 Nov 2012)
@@ -24,37 +24,37 @@
BOOST_AUTO_TEST_CASE( test_single_range )
{
- BOOST_CHECKA( data::xrange( 5 ).size() == 5 );
- BOOST_CHECKA( data::xrange( 3. ).size() == 3 );
+ BOOST_TEST( data::xrange( 5 ).size() == 5 );
+ BOOST_TEST( data::xrange( 3. ).size() == 3 );
BOOST_CHECK_THROW( data::xrange( -5 ), std::logic_error );
BOOST_CHECK_THROW( data::xrange( 0 ), std::logic_error );
- BOOST_CHECKA( data::xrange( 1, 5 ).size() == 4 );
- BOOST_CHECKA( data::xrange( -5, 0 ).size() == 5 );
- BOOST_CHECKA( data::xrange( 1., 7.5 ).size() == 7 );
+ BOOST_TEST( data::xrange( 1, 5 ).size() == 4 );
+ BOOST_TEST( data::xrange( -5, 0 ).size() == 5 );
+ BOOST_TEST( data::xrange( 1., 7.5 ).size() == 7 );
BOOST_CHECK_THROW( data::xrange( 0, 0 ), std::logic_error );
BOOST_CHECK_THROW( data::xrange( 3, 1 ), std::logic_error );
- BOOST_CHECKA( data::xrange( 3, 9, 2 ).size() == 3 );
- BOOST_CHECKA( data::xrange( 5, 0, -1 ).size() == 5 );
- BOOST_CHECKA( data::xrange( 1, 10, 2 ).size() == 5 );
- BOOST_CHECKA( data::xrange( 1, 10, 3 ).size() == 3 );
- BOOST_CHECKA( data::xrange( 1, 10, 8 ).size() == 2 );
- BOOST_CHECKA( data::xrange( 0., 3., 0.4 ).size() == 8 );
- BOOST_CHECKA( data::xrange( 1e-6, 2.e-6, 1e-9 ).size() == 1000 );
-
- BOOST_CHECKA( data::xrange<int>(( data::begin = 9, data::end = 15 )).size() == 6 );
- BOOST_CHECKA( data::xrange<double>(( data::step = 0.5, data::end = 3 )).size() == 6 );
-
+ BOOST_TEST( data::xrange( 3, 9, 2 ).size() == 3 );
+ BOOST_TEST( data::xrange( 5, 0, -1 ).size() == 5 );
+ BOOST_TEST( data::xrange( 1, 10, 2 ).size() == 5 );
+ BOOST_TEST( data::xrange( 1, 10, 3 ).size() == 3 );
+ BOOST_TEST( data::xrange( 1, 10, 8 ).size() == 2 );
+ BOOST_TEST( data::xrange( 0., 3., 0.4 ).size() == 8 );
+ BOOST_TEST( data::xrange( 1e-6, 2.e-6, 1e-9 ).size() == 1000 );
+
+ BOOST_TEST( data::xrange<int>(( data::begin = 9, data::end = 15 )).size() == 6 );
+ BOOST_TEST( data::xrange<double>(( data::step = 0.5, data::end = 3 )).size() == 6 );
+
int c = 0;
data::for_each_sample( data::xrange( 3 ), [&c](int a) {
- BOOST_CHECKA( a == c++ );
+ BOOST_TEST( a == c++ );
});
c = 1;
data::for_each_sample( data::xrange( 1, 10, 2 ), [&c](int a) {
- BOOST_CHECKA( a == c );
+ BOOST_TEST( a == c );
c += 2;
});
}
@@ -63,19 +63,19 @@
{
auto ds = data::xrange( 1, 4 ) + data::xrange( 7, 11 );
- BOOST_CHECKA( ds.size() == 7 );
+ BOOST_TEST( ds.size() == 7 );
invocation_count ic;
ic.m_value = 0;
data::for_each_sample( ds, ic );
- BOOST_CHECKA( ic.m_value == 7 );
+ BOOST_TEST( ic.m_value == 7 );
int arr[] = {1,2,3,7,8,9,10};
int* exp = arr;
int c = 0;
data::for_each_sample( ds, [&c,exp](int a) {
- BOOST_CHECKA( a == exp[c++] );
+ BOOST_TEST( a == exp[c++] );
});
}
Modified: trunk/libs/test/test/test_files/test_tools_test.pattern
==============================================================================
--- trunk/libs/test/test/test_files/test_tools_test.pattern (original)
+++ trunk/libs/test/test/test_files/test_tools_test.pattern 2012-11-01 18:25:57 EDT (Thu, 01 Nov 2012)
@@ -102,26 +102,29 @@
Failure occurred in a following context:
outer context
653: info: check true passed
-654: error: in "test_BOOST_CHECKA": check false failed
+654: error: in "test_BOOST_TEST_universal": check false failed
657: info: check bc passed
-660: error: in "test_BOOST_CHECKA": check i == 2 failed [1!=2]
-661: error: in "test_BOOST_CHECKA": check i != 1 failed [1==1]
-662: error: in "test_BOOST_CHECKA": check i > 2 failed [1<=2]
-663: error: in "test_BOOST_CHECKA": check i < 1 failed [1>=1]
-664: error: in "test_BOOST_CHECKA": check i <= 0 failed [1>0]
-665: error: in "test_BOOST_CHECKA": check i >= 5 failed [1<5]
-668: error: in "test_BOOST_CHECKA": check i+j >= 5 failed [1+2<5]
-669: error: in "test_BOOST_CHECKA": check j-i == 2 failed [2-1!=2]
-672: error: in "test_BOOST_CHECKA": check *p == 2 failed [1!=2]
-673: error: in "test_BOOST_CHECKA": check j-*p == 0 failed [2-1!=0]
-675: info: check ( i > 5, true ) passed
-679: error: in "test_BOOST_CHECKA": check FooType() failed [(bool)0 is false]
-680: error: in "test_BOOST_CHECKA": check *F failed [(bool)0 is false]
-681: error: in "test_BOOST_CHECKA": check **F failed [(bool)0 is false]
-682: error: in "test_BOOST_CHECKA": check ***F failed [(bool)0 is false]
-683: error: in "test_BOOST_CHECKA": check &F > 100 failed [10<=100]
-684: error: in "test_BOOST_CHECKA": check &*F > 100 failed [10<=100]
-686: error: in "test_BOOST_CHECKA": check (i == 1) & (j == 1) failed [1&0]
-687: error: in "test_BOOST_CHECKA": check (i == 2) | (j == 1) failed [0|0]
-689: error: in "test_BOOST_CHECKA": check ( i == 1 && j == 1 ) failed
-690: error: in "test_BOOST_CHECKA": check ( i == 2 || j == 1 ) failed
+660: error: in "test_BOOST_TEST_universal": check i == 2 failed [1!=2]
+661: error: in "test_BOOST_TEST_universal": check i != 1 failed [1==1]
+662: error: in "test_BOOST_TEST_universal": check i > 2 failed [1<=2]
+663: error: in "test_BOOST_TEST_universal": check i < 1 failed [1>=1]
+664: error: in "test_BOOST_TEST_universal": check i <= 0 failed [1>0]
+665: error: in "test_BOOST_TEST_universal": check i >= 5 failed [1<5]
+669: error: in "test_BOOST_TEST_universal": check i+j >= 5 failed [1+2<5]
+670: error: in "test_BOOST_TEST_universal": check j-i == 2 failed [2-1!=2]
+674: error: in "test_BOOST_TEST_universal": check *p == 2 failed [1!=2]
+677: error: in "test_BOOST_TEST_universal": check j-*p == 0 failed [2-1!=0]
+680: info: check ( i > 5, true ) passed
+684: error: in "test_BOOST_TEST_universal": check FooType() failed [(bool)0 is false]
+685: error: in "test_BOOST_TEST_universal": check *F failed [(bool)0 is false]
+686: error: in "test_BOOST_TEST_universal": check **F failed [(bool)0 is false]
+687: error: in "test_BOOST_TEST_universal": check ***F failed [(bool)0 is false]
+688: error: in "test_BOOST_TEST_universal": check &F > 100 failed [10<=100]
+689: error: in "test_BOOST_TEST_universal": check &*F > 100 failed [10<=100]
+692: error: in "test_BOOST_TEST_universal": check (i == 1) & (j == 1) failed [1&0]
+693: error: in "test_BOOST_TEST_universal": check (i == 2) | (j == 1) failed [0|0]
+696: error: in "test_BOOST_TEST_universal": check ( i == 1 && j == 1 ) failed
+697: error: in "test_BOOST_TEST_universal": check ( i == 2 || j == 1 ) failed
+700: error: in "test_BOOST_TEST_universal": This message reported instead
+705: info: check true passed
+711: info: check true passed
Modified: trunk/libs/test/test/test_tools_test.cpp
==============================================================================
--- trunk/libs/test/test/test_tools_test.cpp (original)
+++ trunk/libs/test/test/test_tools_test.cpp 2012-11-01 18:25:57 EDT (Thu, 01 Nov 2012)
@@ -646,56 +646,74 @@
int operator&() { return 10; }
};
-TEST_CASE( test_BOOST_CHECKA )
+TEST_CASE( test_BOOST_TEST_universal )
{
unit_test_log.set_threshold_level( log_successful_tests );
- BOOST_CHECKA( true );
- BOOST_CHECKA( false );
+ BOOST_TEST( true );
+ BOOST_TEST( false );
bool_convertible bc;
- BOOST_CHECKA( bc );
+ BOOST_TEST( bc );
int i = 1;
- BOOST_CHECKA( i == 2 );
- BOOST_CHECKA( i != 1 );
- BOOST_CHECKA( i > 2 );
- BOOST_CHECKA( i < 1 );
- BOOST_CHECKA( i <= 0 );
- BOOST_CHECKA( i >= 5 );
+ BOOST_TEST( i == 2 );
+ BOOST_TEST( i != 1 );
+ BOOST_TEST( i > 2 );
+ BOOST_TEST( i < 1 );
+ BOOST_TEST( i <= 0 );
+ BOOST_TEST( i >= 5 );
int j = 2;
- BOOST_CHECKA( i+j >= 5 );
- BOOST_CHECKA( j-i == 2 );
+#ifdef BOOST_HAS_DECLTYPE
+ BOOST_TEST( i+j >= 5 );
+ BOOST_TEST( j-i == 2 );
+#endif
int* p = &i;
- BOOST_CHECKA( *p == 2 );
- BOOST_CHECKA( j-*p == 0 );
+ BOOST_TEST( *p == 2 );
- BOOST_CHECKA(( i > 5, true ));
+#ifdef BOOST_HAS_DECLTYPE
+ BOOST_TEST( j-*p == 0 );
+#endif
+
+ BOOST_TEST(( i > 5, true ));
FooType F;
- BOOST_CHECKA( FooType() );
- BOOST_CHECKA( *F );
- BOOST_CHECKA( **F );
- BOOST_CHECKA( ***F );
- BOOST_CHECKA( &F > 100 );
- BOOST_CHECKA( &*F > 100 );
-
- BOOST_CHECKA( (i == 1) & (j == 1) );
- BOOST_CHECKA( (i == 2) | (j == 1) );
-
- BOOST_CHECKA(( i == 1 && j == 1 ));
- BOOST_CHECKA(( i == 2 || j == 1 ));
-
- std::cout << MACROV() << std::endl;
- std::cout << MACROV(q) << std::endl;
- std::cout << MACROV(q,w) << std::endl;
- // Does not work
- // BOOST_CHECKA( i == 1 && j == 1 );
- // BOOST_CHECKA( i == 2 || j == 1 );
- // BOOST_CHECKA( i > 5 ? false : true );
+ BOOST_TEST( FooType() );
+ BOOST_TEST( *F );
+ BOOST_TEST( **F );
+ BOOST_TEST( ***F );
+ BOOST_TEST( &F > 100 );
+ BOOST_TEST( &*F > 100 );
+
+#ifdef BOOST_HAS_DECLTYPE
+ BOOST_TEST( (i == 1) & (j == 1) );
+ BOOST_TEST( (i == 2) | (j == 1) );
+#endif
+
+ BOOST_TEST(( i == 1 && j == 1 ));
+ BOOST_TEST(( i == 2 || j == 1 ));
+
+#if BOOST_PP_VARIADICS
+ BOOST_TEST( i+j==15,"This message reported instead");
+#endif
+
+ // check correct behavior in if clause
+ if( true )
+ BOOST_TEST( true );
+
+ // check correct behavior in else clause
+ if( false )
+ {}
+ else
+ BOOST_TEST( true );
+
+ // Does not work
+ // BOOST_TEST( i == 1 && j == 1 );
+ // BOOST_TEST( i == 2 || j == 1 );
+ // BOOST_TEST( i > 5 ? false : true );
}
//____________________________________________________________________________//
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk