Yes, I was looking at these examples all the time:
http://www.boost.org/doc/libs/1_45_0/libs/test/doc/html/utf/testing-tools/custom-predicate.html
but i couldn't actually find that there is a solution to my problem and your suggestion gave me direction.
Complete solution looks like this:
using namespace boost::test_tools;
predicate_result
compare(MyClass const& expected, MyClass const& received)
{
if(expected.a != received.a) {
predicate_result res( false );
res.message() << "Difference in field a: " << expected.a << ", " << received.a;
return res;
}
if(expected.b != received.b) {
predicate_result res( false );
res.message() << "Difference in field b: " << expected.b << ", " << received.b;
return res;
}
return true;
}
Thanks
> Thank you Gennadiy, now it works like it should :)RegardsActually in a haste I forgot to actually write "return res;" and the result type
should be predicate_result, but looks like you've figured it out ;)
Gennadiy
_______________________________________________
Boost-Testing mailing list
Boost-Testing@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-testing