forked from boostorg/algorithm
Updated Boost.Algorithm tests to use non-deprecated test framework
[SVN r82785]
This commit is contained in:
@ -9,51 +9,60 @@
|
||||
|
||||
import testing ;
|
||||
|
||||
alias unit_test_framework
|
||||
: # sources
|
||||
/boost//unit_test_framework
|
||||
;
|
||||
|
||||
|
||||
{
|
||||
test-suite algorithm:
|
||||
# Search tests
|
||||
: [ run empty_search_test.cpp : : : : empty_search_test ]
|
||||
[ run search_test1.cpp : : : : search_test1 ]
|
||||
[ run search_test2.cpp : : : : search_test2 ]
|
||||
[ run search_test3.cpp : : : : search_test3 ]
|
||||
[ run search_test4.cpp : : : : search_test4 ]
|
||||
[ compile-fail search_fail1.cpp : : : : ]
|
||||
[ compile-fail search_fail2.cpp : : : : ]
|
||||
[ compile-fail search_fail3.cpp : : : : ]
|
||||
: [ run empty_search_test.cpp unit_test_framework : : : : empty_search_test ]
|
||||
[ run search_test1.cpp unit_test_framework : : : : search_test1 ]
|
||||
[ run search_test2.cpp unit_test_framework : : : : search_test2 ]
|
||||
[ run search_test3.cpp unit_test_framework : : : : search_test3 ]
|
||||
[ run search_test4.cpp unit_test_framework : : : : search_test4 ]
|
||||
[ compile-fail search_fail1.cpp : : : : ]
|
||||
[ compile-fail search_fail2.cpp : : : : ]
|
||||
[ compile-fail search_fail3.cpp : : : : ]
|
||||
|
||||
# Clamp tests
|
||||
[ run clamp_test.cpp : : : : clamp_test ]
|
||||
[ run clamp_test.cpp unit_test_framework : : : : clamp_test ]
|
||||
|
||||
# Cxx11 tests
|
||||
[ run all_of_test.cpp : : : : all_of_test ]
|
||||
[ run any_of_test.cpp : : : : any_of_test ]
|
||||
[ run none_of_test.cpp : : : : none_of_test ]
|
||||
[ run one_of_test.cpp : : : : one_of_test ]
|
||||
[ run all_of_test.cpp unit_test_framework : : : : all_of_test ]
|
||||
[ run any_of_test.cpp unit_test_framework : : : : any_of_test ]
|
||||
[ run none_of_test.cpp unit_test_framework : : : : none_of_test ]
|
||||
[ run one_of_test.cpp unit_test_framework : : : : one_of_test ]
|
||||
|
||||
[ run ordered_test.cpp : : : : ordered_test ]
|
||||
[ run find_if_not_test1.cpp : : : : find_if_not_test1 ]
|
||||
[ run copy_if_test1.cpp : : : : copy_if_test1 ]
|
||||
[ run copy_n_test1.cpp : : : : copy_n_test1 ]
|
||||
[ run iota_test1.cpp : : : : iota_test1 ]
|
||||
[ run ordered_test.cpp unit_test_framework : : : : ordered_test ]
|
||||
[ run find_if_not_test1.cpp unit_test_framework : : : : find_if_not_test1 ]
|
||||
[ run copy_if_test1.cpp unit_test_framework : : : : copy_if_test1 ]
|
||||
[ run copy_n_test1.cpp unit_test_framework : : : : copy_n_test1 ]
|
||||
[ run iota_test1.cpp unit_test_framework : : : : iota_test1 ]
|
||||
|
||||
[ run is_permutation_test1.cpp : : : : is_permutation_test1 ]
|
||||
[ run partition_point_test1.cpp : : : : partition_point_test1 ]
|
||||
[ run is_partitioned_test1.cpp : : : : is_partitioned_test1 ]
|
||||
[ run partition_copy_test1.cpp : : : : partition_copy_test1 ]
|
||||
[ run is_permutation_test1.cpp unit_test_framework : : : : is_permutation_test1 ]
|
||||
[ run partition_point_test1.cpp unit_test_framework : : : : partition_point_test1 ]
|
||||
[ run is_partitioned_test1.cpp unit_test_framework : : : : is_partitioned_test1 ]
|
||||
[ run partition_copy_test1.cpp unit_test_framework : : : : partition_copy_test1 ]
|
||||
|
||||
# Hex tests
|
||||
[ run hex_test1.cpp : : : : hex_test1 ]
|
||||
[ run hex_test2.cpp : : : : hex_test2 ]
|
||||
[ run hex_test3.cpp : : : : hex_test3 ]
|
||||
[ run hex_test4.cpp : : : : hex_test4 ]
|
||||
[ run hex_test1.cpp unit_test_framework : : : : hex_test1 ]
|
||||
[ run hex_test2.cpp unit_test_framework : : : : hex_test2 ]
|
||||
[ run hex_test3.cpp unit_test_framework : : : : hex_test3 ]
|
||||
[ run hex_test4.cpp unit_test_framework : : : : hex_test4 ]
|
||||
[ compile-fail hex_fail1.cpp ]
|
||||
|
||||
# Wrapper tests
|
||||
[ run wrapper_test1.cpp : : : : wrapper_test1 ]
|
||||
[ run wrapper_test1.cpp unit_test_framework : : : : wrapper_test1 ]
|
||||
|
||||
# Gather tests
|
||||
[ run gather_test1.cpp : : : : gather_test1 ]
|
||||
[ run gather_test1.cpp unit_test_framework : : : : gather_test1 ]
|
||||
[ compile-fail gather_fail1.cpp ]
|
||||
|
||||
# Dummy test
|
||||
[ run dummy_test.cpp unit_test_framework : : : : dummy_test ]
|
||||
;
|
||||
}
|
||||
|
||||
|
@ -9,7 +9,9 @@
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/algorithm/cxx11/all_of.hpp>
|
||||
#include <boost/test/included/test_exec_monitor.hpp>
|
||||
|
||||
#define BOOST_TEST_MAIN
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
||||
#include <functional>
|
||||
#include <vector>
|
||||
@ -79,8 +81,7 @@ void test_all ()
|
||||
}
|
||||
|
||||
|
||||
int test_main( int , char* [] )
|
||||
BOOST_AUTO_TEST_CASE( test_main )
|
||||
{
|
||||
test_all ();
|
||||
return 0;
|
||||
}
|
||||
|
@ -9,7 +9,9 @@
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/algorithm/cxx11/any_of.hpp>
|
||||
#include <boost/test/included/test_exec_monitor.hpp>
|
||||
|
||||
#define BOOST_TEST_MAIN
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
||||
#include <functional>
|
||||
#include <vector>
|
||||
@ -98,8 +100,7 @@ void test_any ()
|
||||
}
|
||||
|
||||
|
||||
int test_main( int , char* [] )
|
||||
BOOST_AUTO_TEST_CASE( test_main )
|
||||
{
|
||||
test_any ();
|
||||
return 0;
|
||||
}
|
||||
|
@ -9,7 +9,8 @@
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/algorithm/clamp.hpp>
|
||||
|
||||
#include <boost/test/included/test_exec_monitor.hpp>
|
||||
#define BOOST_TEST_MAIN
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
||||
namespace ba = boost::algorithm;
|
||||
|
||||
@ -205,7 +206,7 @@ void test_int_range ()
|
||||
BOOST_CHECK ( std::equal ( b_e(junk), outputs ));
|
||||
}
|
||||
|
||||
int test_main( int , char* [] )
|
||||
BOOST_AUTO_TEST_CASE( test_main )
|
||||
{
|
||||
test_ints ();
|
||||
test_floats ();
|
||||
@ -214,5 +215,4 @@ int test_main( int , char* [] )
|
||||
test_int_range ();
|
||||
// test_float_range ();
|
||||
// test_custom_range ();
|
||||
return 0;
|
||||
}
|
||||
|
@ -9,7 +9,9 @@
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/algorithm/cxx11/copy_if.hpp>
|
||||
#include <boost/test/included/test_exec_monitor.hpp>
|
||||
|
||||
#define BOOST_TEST_MAIN
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
||||
#include <algorithm>
|
||||
#include <string>
|
||||
@ -57,12 +59,12 @@ void test_sequence ( Container const &c ) {
|
||||
// Some of the elements
|
||||
v.clear ();
|
||||
ba::copy_if ( c.begin (), c.end (), back_inserter ( v ), is_even );
|
||||
BOOST_CHECK ( v.size () == std::count_if ( c.begin (), c.end (), is_even ));
|
||||
BOOST_CHECK ( v.size () == (size_t) std::count_if ( c.begin (), c.end (), is_even ));
|
||||
BOOST_CHECK ( ba::all_of ( v.begin (), v.end (), is_even ));
|
||||
|
||||
v.clear ();
|
||||
ba::copy_if ( c, back_inserter ( v ), is_even );
|
||||
BOOST_CHECK ( v.size () == std::count_if ( c.begin (), c.end (), is_even ));
|
||||
BOOST_CHECK ( v.size () == (size_t) std::count_if ( c.begin (), c.end (), is_even ));
|
||||
BOOST_CHECK ( ba::all_of ( v.begin (), v.end (), is_even ));
|
||||
}
|
||||
|
||||
@ -80,8 +82,7 @@ void test_sequence1 () {
|
||||
}
|
||||
|
||||
|
||||
int test_main( int , char* [] )
|
||||
BOOST_AUTO_TEST_CASE( test_main )
|
||||
{
|
||||
test_sequence1 ();
|
||||
return 0;
|
||||
}
|
||||
|
@ -9,7 +9,9 @@
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/algorithm/cxx11/copy_n.hpp>
|
||||
#include <boost/test/included/test_exec_monitor.hpp>
|
||||
|
||||
#define BOOST_TEST_MAIN
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
@ -78,8 +80,7 @@ void test_sequence1 () {
|
||||
}
|
||||
|
||||
|
||||
int test_main( int , char* [] )
|
||||
BOOST_AUTO_TEST_CASE( test_main )
|
||||
{
|
||||
test_sequence1 ();
|
||||
return 0;
|
||||
}
|
||||
|
@ -13,9 +13,10 @@
|
||||
#include <boost/algorithm/searching/boyer_moore_horspool.hpp>
|
||||
#include <boost/algorithm/searching/knuth_morris_pratt.hpp>
|
||||
|
||||
#include <boost/test/included/test_exec_monitor.hpp>
|
||||
#define BOOST_TEST_MAIN
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
||||
int test_main( int argc, char *argv [] )
|
||||
BOOST_AUTO_TEST_CASE( test_main )
|
||||
{
|
||||
const std::string cs;
|
||||
std::string estr;
|
||||
@ -77,7 +78,4 @@ int test_main( int argc, char *argv [] )
|
||||
str.begin (), str.end (), estr.begin (), estr.end ())
|
||||
== str.begin ()
|
||||
);
|
||||
|
||||
(void) argv; (void) argc;
|
||||
return 0;
|
||||
}
|
||||
|
@ -11,7 +11,9 @@
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/algorithm/cxx11/find_if_not.hpp>
|
||||
#include <boost/test/included/test_exec_monitor.hpp>
|
||||
|
||||
#define BOOST_TEST_MAIN
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
@ -83,8 +85,7 @@ void test_sequence1 () {
|
||||
}
|
||||
|
||||
|
||||
int test_main( int , char* [] )
|
||||
BOOST_AUTO_TEST_CASE( test_main )
|
||||
{
|
||||
test_sequence1 ();
|
||||
return 0;
|
||||
}
|
||||
|
@ -11,7 +11,6 @@
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/algorithm/gather.hpp>
|
||||
#include <boost/test/included/test_exec_monitor.hpp>
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
@ -32,7 +31,7 @@ void test_sequence1 () {
|
||||
}
|
||||
|
||||
|
||||
int test_main( int , char* [] )
|
||||
int main ()
|
||||
{
|
||||
test_sequence1 ();
|
||||
return 0;
|
||||
|
@ -11,7 +11,9 @@
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/algorithm/gather.hpp>
|
||||
#include <boost/test/included/test_exec_monitor.hpp>
|
||||
|
||||
#define BOOST_TEST_MAIN
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
@ -132,8 +134,7 @@ void test_sequence1 () {
|
||||
}
|
||||
|
||||
|
||||
int test_main( int , char* [] )
|
||||
BOOST_AUTO_TEST_CASE( test_main )
|
||||
{
|
||||
test_sequence1 ();
|
||||
return 0;
|
||||
}
|
||||
|
@ -9,17 +9,17 @@
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/algorithm/hex.hpp>
|
||||
#include <boost/test/included/test_exec_monitor.hpp>
|
||||
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
|
||||
// should not compile: vector is not an integral type
|
||||
int test_main( int , char* [] )
|
||||
int main( int , char* [] )
|
||||
{
|
||||
std::vector<float> v;
|
||||
std::string out;
|
||||
boost::algorithm::unhex ( out, std::back_inserter(v));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -9,7 +9,9 @@
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/algorithm/hex.hpp>
|
||||
#include <boost/test/included/test_exec_monitor.hpp>
|
||||
|
||||
#define BOOST_TEST_MAIN
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
@ -141,7 +143,7 @@ const wchar_t *fromhex_fail_w [] = {
|
||||
};
|
||||
|
||||
|
||||
int test_main( int , char* [] )
|
||||
BOOST_AUTO_TEST_CASE( test_main )
|
||||
{
|
||||
test_to_hex<std::string> ( tohex );
|
||||
test_from_hex_success<std::string> ( fromhex );
|
||||
@ -150,5 +152,4 @@ int test_main( int , char* [] )
|
||||
test_to_hex<std::wstring> ( tohex_w );
|
||||
test_from_hex_success<std::wstring> ( fromhex_w );
|
||||
test_from_hex_failure<std::wstring> ( fromhex_fail_w );
|
||||
return 0;
|
||||
}
|
||||
|
@ -11,7 +11,9 @@ Test non-string cases; vector and list
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/algorithm/hex.hpp>
|
||||
#include <boost/test/included/test_exec_monitor.hpp>
|
||||
|
||||
#define BOOST_TEST_MAIN
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
@ -129,9 +131,8 @@ void test_from_hex_success () {
|
||||
}
|
||||
|
||||
|
||||
int test_main( int , char* [] )
|
||||
BOOST_AUTO_TEST_CASE( test_main )
|
||||
{
|
||||
test_to_hex ();
|
||||
test_from_hex_success ();
|
||||
return 0;
|
||||
}
|
||||
|
@ -11,7 +11,9 @@ Try ostream_iterators
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/algorithm/hex.hpp>
|
||||
#include <boost/test/included/test_exec_monitor.hpp>
|
||||
|
||||
#define BOOST_TEST_MAIN
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
@ -113,11 +115,10 @@ const wchar_t *fromhex_w [] = {
|
||||
|
||||
|
||||
|
||||
int test_main( int , char* [] )
|
||||
BOOST_AUTO_TEST_CASE( test_main )
|
||||
{
|
||||
test_to_hex ( tohex );
|
||||
test_to_hex ( tohex_w );
|
||||
test_from_hex_success ( fromhex );
|
||||
test_from_hex_success ( fromhex_w );
|
||||
return 0;
|
||||
}
|
||||
|
@ -11,7 +11,9 @@ Try ostream_iterators
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/algorithm/hex.hpp>
|
||||
#include <boost/test/included/test_exec_monitor.hpp>
|
||||
|
||||
#define BOOST_TEST_MAIN
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
@ -136,10 +138,8 @@ void test_nonhex_input () {
|
||||
test_nonhex_input4 ();
|
||||
}
|
||||
|
||||
int test_main( int , char* [] )
|
||||
BOOST_AUTO_TEST_CASE( test_main )
|
||||
{
|
||||
test_short_input ();
|
||||
test_nonhex_input ();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -9,7 +9,9 @@
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/algorithm/cxx11/iota.hpp>
|
||||
#include <boost/test/included/test_exec_monitor.hpp>
|
||||
|
||||
#define BOOST_TEST_MAIN
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
@ -72,8 +74,7 @@ void test_ints () {
|
||||
}
|
||||
|
||||
|
||||
int test_main( int , char* [] )
|
||||
BOOST_AUTO_TEST_CASE( test_main )
|
||||
{
|
||||
test_ints ();
|
||||
return 0;
|
||||
}
|
||||
|
@ -11,7 +11,9 @@
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/algorithm/cxx11/is_partitioned.hpp>
|
||||
#include <boost/test/included/test_exec_monitor.hpp>
|
||||
|
||||
#define BOOST_TEST_MAIN
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
@ -56,8 +58,7 @@ void test_sequence1 () {
|
||||
}
|
||||
|
||||
|
||||
int test_main( int , char* [] )
|
||||
BOOST_AUTO_TEST_CASE( test_main )
|
||||
{
|
||||
test_sequence1 ();
|
||||
return 0;
|
||||
}
|
||||
|
@ -11,7 +11,9 @@
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/algorithm/cxx11/is_permutation.hpp>
|
||||
#include <boost/test/included/test_exec_monitor.hpp>
|
||||
|
||||
#define BOOST_TEST_MAIN
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
@ -42,8 +44,7 @@ void test_sequence1 () {
|
||||
}
|
||||
|
||||
|
||||
int test_main( int , char* [] )
|
||||
BOOST_AUTO_TEST_CASE( test_main )
|
||||
{
|
||||
test_sequence1 ();
|
||||
return 0;
|
||||
}
|
||||
|
@ -9,7 +9,9 @@
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/algorithm/cxx11/none_of.hpp>
|
||||
#include <boost/test/included/test_exec_monitor.hpp>
|
||||
|
||||
#define BOOST_TEST_MAIN
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
||||
#include <functional>
|
||||
#include <vector>
|
||||
@ -89,8 +91,7 @@ void test_none()
|
||||
BOOST_CHECK (!ba::none_of ( li.begin(), l_iter, is_<int> ( 5 )));
|
||||
}
|
||||
|
||||
int test_main( int , char* [] )
|
||||
BOOST_AUTO_TEST_CASE( test_main )
|
||||
{
|
||||
test_none();
|
||||
return 0;
|
||||
}
|
||||
|
@ -9,7 +9,9 @@
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/algorithm/cxx11/one_of.hpp>
|
||||
#include <boost/test/included/test_exec_monitor.hpp>
|
||||
|
||||
#define BOOST_TEST_MAIN
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
||||
#include <functional>
|
||||
#include <vector>
|
||||
@ -94,8 +96,7 @@ void test_one ()
|
||||
}
|
||||
|
||||
|
||||
int test_main( int , char* [] )
|
||||
BOOST_AUTO_TEST_CASE( test_main )
|
||||
{
|
||||
test_one ();
|
||||
return 0;
|
||||
}
|
||||
|
@ -13,7 +13,9 @@
|
||||
#include <iostream>
|
||||
|
||||
#include <boost/algorithm/cxx11/is_sorted.hpp>
|
||||
#include <boost/test/included/test_exec_monitor.hpp>
|
||||
|
||||
#define BOOST_TEST_MAIN
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
||||
using namespace boost;
|
||||
|
||||
@ -146,9 +148,8 @@ test_increasing_decreasing(void)
|
||||
|
||||
}
|
||||
|
||||
int test_main( int, char * [] )
|
||||
BOOST_AUTO_TEST_CASE( test_main )
|
||||
{
|
||||
test_ordered ();
|
||||
test_increasing_decreasing ();
|
||||
return 0;
|
||||
}
|
||||
|
@ -11,7 +11,9 @@
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/algorithm/cxx11/partition_copy.hpp>
|
||||
#include <boost/test/included/test_exec_monitor.hpp>
|
||||
|
||||
#define BOOST_TEST_MAIN
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
||||
#include <boost/algorithm/cxx11/all_of.hpp>
|
||||
#include <boost/algorithm/cxx11/none_of.hpp>
|
||||
@ -80,8 +82,7 @@ void test_sequence1 () {
|
||||
}
|
||||
|
||||
|
||||
int test_main( int , char* [] )
|
||||
BOOST_AUTO_TEST_CASE( test_main )
|
||||
{
|
||||
test_sequence1 ();
|
||||
return 0;
|
||||
}
|
||||
|
@ -11,7 +11,9 @@
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/algorithm/cxx11/partition_point.hpp>
|
||||
#include <boost/test/included/test_exec_monitor.hpp>
|
||||
|
||||
#define BOOST_TEST_MAIN
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
@ -91,8 +93,7 @@ void test_sequence1 () {
|
||||
}
|
||||
|
||||
|
||||
int test_main( int , char* [] )
|
||||
BOOST_AUTO_TEST_CASE( test_main )
|
||||
{
|
||||
test_sequence1 ();
|
||||
return 0;
|
||||
}
|
||||
|
@ -10,7 +10,7 @@
|
||||
#include <vector>
|
||||
#include <boost/algorithm/searching/boyer_moore.hpp>
|
||||
|
||||
int main( int argc, char *argv [] )
|
||||
int main( int , char* [] )
|
||||
{
|
||||
std::vector<char> cv;
|
||||
std::vector<int> iv;
|
||||
@ -20,7 +20,5 @@ int main( int argc, char *argv [] )
|
||||
(void) boost::algorithm::boyer_moore_search (
|
||||
cv.begin (), cv.end (), iv.begin (), iv.end ());
|
||||
|
||||
|
||||
(void) argv; (void) argc;
|
||||
return 0;
|
||||
}
|
||||
|
@ -11,7 +11,7 @@
|
||||
#include <boost/cstdint.hpp>
|
||||
#include <boost/algorithm/searching/boyer_moore.hpp>
|
||||
|
||||
int main( int argc, char *argv [] )
|
||||
int main( int , char* [] )
|
||||
{
|
||||
std::vector<boost::uint8_t> cv;
|
||||
std::vector<boost:: int8_t> iv;
|
||||
@ -21,7 +21,5 @@ int main( int argc, char *argv [] )
|
||||
(void) boost::algorithm::boyer_moore_search (
|
||||
cv.begin (), cv.end (), iv.begin (), iv.end ());
|
||||
|
||||
|
||||
(void) argv; (void) argc;
|
||||
return 0;
|
||||
}
|
||||
|
@ -10,11 +10,10 @@
|
||||
#include <vector>
|
||||
#include <boost/algorithm/searching/boyer_moore.hpp>
|
||||
|
||||
int main( int argc, char *argv [] )
|
||||
int main( int , char* [] )
|
||||
{
|
||||
// Should fail to compile because the search objects are not default-constructible
|
||||
boost::algorithm::boyer_moore<std::vector<char>::iterator> bm;
|
||||
|
||||
(void) argv; (void) argc;
|
||||
return 0;
|
||||
}
|
||||
|
@ -11,7 +11,8 @@
|
||||
#include <boost/algorithm/searching/boyer_moore_horspool.hpp>
|
||||
#include <boost/algorithm/searching/knuth_morris_pratt.hpp>
|
||||
|
||||
#include <boost/test/included/test_exec_monitor.hpp>
|
||||
#define BOOST_TEST_MAIN
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
@ -218,7 +219,7 @@ namespace {
|
||||
}
|
||||
|
||||
|
||||
int test_main( int , char* [] )
|
||||
BOOST_AUTO_TEST_CASE( test_main )
|
||||
{
|
||||
std::string haystack1 ( "NOW AN FOWE\220ER ANNMAN THE ANPANMANEND" );
|
||||
std::string needle1 ( "ANPANMAN" );
|
||||
@ -268,5 +269,4 @@ int test_main( int , char* [] )
|
||||
const std::string mikhail_corpus = std::string (8, 'a') + mikhail_pattern;
|
||||
|
||||
check_one ( mikhail_corpus, mikhail_pattern, 8 );
|
||||
return 0;
|
||||
}
|
||||
|
@ -11,9 +11,12 @@
|
||||
#include <boost/algorithm/searching/boyer_moore_horspool.hpp>
|
||||
#include <boost/algorithm/searching/knuth_morris_pratt.hpp>
|
||||
|
||||
#include <boost/test/included/test_exec_monitor.hpp>
|
||||
#define BOOST_TEST_MAIN
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <iomanip>
|
||||
#include <algorithm>
|
||||
#include <vector>
|
||||
|
||||
@ -122,7 +125,7 @@ namespace {
|
||||
}
|
||||
}
|
||||
|
||||
int test_main( int , char* [] )
|
||||
BOOST_AUTO_TEST_CASE( test_main )
|
||||
{
|
||||
vec c1 = ReadFromFile ( "search_test_data/0001.corpus" );
|
||||
vec p1b = ReadFromFile ( "search_test_data/0001b.pat" );
|
||||
@ -140,6 +143,4 @@ int test_main( int , char* [] )
|
||||
check_one ( c1, p1e, c1.size() - p1e.size ());
|
||||
std::cout << "--- Not found ---" << std::endl;
|
||||
check_one ( c1, p1n, -1 ); // Not found
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -11,9 +11,12 @@
|
||||
#include <boost/algorithm/searching/boyer_moore_horspool.hpp>
|
||||
#include <boost/algorithm/searching/knuth_morris_pratt.hpp>
|
||||
|
||||
#include <boost/test/included/test_exec_monitor.hpp>
|
||||
#define BOOST_TEST_MAIN
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <iomanip>
|
||||
#include <algorithm>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
@ -122,7 +125,7 @@ namespace {
|
||||
}
|
||||
}
|
||||
|
||||
int test_main( int , char* [] )
|
||||
BOOST_AUTO_TEST_CASE( test_main )
|
||||
{
|
||||
vec c1 = ReadFromFile ( "search_test_data/0001.corpus" );
|
||||
vec p1b = ReadFromFile ( "search_test_data/0002b.pat" );
|
||||
@ -140,6 +143,4 @@ int test_main( int , char* [] )
|
||||
check_one ( c1, p1e, c1.size() - p1e.size ());
|
||||
std::cout << "--- Not found ---" << std::endl;
|
||||
check_one ( c1, p1n, -1 ); // Not found
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -13,9 +13,12 @@
|
||||
#include <boost/algorithm/searching/boyer_moore_horspool.hpp>
|
||||
#include <boost/algorithm/searching/knuth_morris_pratt.hpp>
|
||||
|
||||
#include <boost/test/included/test_exec_monitor.hpp>
|
||||
#define BOOST_TEST_MAIN
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <iomanip>
|
||||
#include <algorithm>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
@ -93,7 +96,7 @@ namespace {
|
||||
|
||||
}
|
||||
|
||||
int test_main( int , char* [] )
|
||||
BOOST_AUTO_TEST_CASE( test_main )
|
||||
{
|
||||
vec c1 = ReadFromFile ( "search_test_data/0001.corpus" );
|
||||
vec p1b = ReadFromFile ( "search_test_data/0002b.pat" );
|
||||
@ -111,6 +114,4 @@ int test_main( int , char* [] )
|
||||
check_one ( c1, p1e, c1.size() - p1e.size ());
|
||||
std::cout << "--- Not found ---" << std::endl;
|
||||
check_one ( c1, p1n, -1 ); // Not found
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -9,7 +9,9 @@
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/algorithm/wrappers.hpp>
|
||||
#include <boost/test/included/test_exec_monitor.hpp>
|
||||
|
||||
#define BOOST_TEST_MAIN
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
||||
#include <functional>
|
||||
#include <string>
|
||||
@ -67,9 +69,8 @@ void test_str ()
|
||||
BOOST_CHECK ( ba::find_ptr ( mm, 55 ) == NULL );
|
||||
}
|
||||
|
||||
int test_main( int , char* [] )
|
||||
BOOST_AUTO_TEST_CASE( test_main )
|
||||
{
|
||||
test_int ();
|
||||
test_str ();
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user