mirror of
https://github.com/boostorg/algorithm.git
synced 2025-07-30 04:27:16 +02:00
predicate test improvements
[SVN r48199]
This commit is contained in:
@ -96,10 +96,28 @@ void predicate_test()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<typename Pred, typename Input>
|
||||||
|
void test_pred(const Pred& pred, const Input& input, bool bYes)
|
||||||
|
{
|
||||||
|
// test assignment operator
|
||||||
|
Pred pred1=pred;
|
||||||
|
pred1=pred;
|
||||||
|
if(bYes)
|
||||||
|
{
|
||||||
|
BOOST_CHECK( all( input, pred ) );
|
||||||
|
BOOST_CHECK( all( input, pred1 ) );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
BOOST_CHECK( !all( input, pred ) );
|
||||||
|
BOOST_CHECK( !all( input, pred1 ) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#define TEST_CLASS( Pred, YesInput, NoInput )\
|
#define TEST_CLASS( Pred, YesInput, NoInput )\
|
||||||
{\
|
{\
|
||||||
BOOST_CHECK( all( string(YesInput), Pred ) );\
|
test_pred(Pred, YesInput, true); \
|
||||||
BOOST_CHECK( !all( string(NoInput), Pred ) );\
|
test_pred(Pred, NoInput, false); \
|
||||||
}
|
}
|
||||||
|
|
||||||
void classification_test()
|
void classification_test()
|
||||||
|
Reference in New Issue
Block a user