Boost logo

Boost Users :

Subject: Re: [Boost-users] Boost.Test - how to print the value of a variable in case of error?
From: Attila Feher F (attila.f.feher_at_[hidden])
Date: 2010-06-27 23:53:42


Steven Watanabe wrote:
[SNIP]
>> ..._CHECKPOINT does not work, because it is only printed in case of
>> an exception, but not other failures. :(
>>
>> I was hoping to find something like:
>>
>> BOOST_CHECK_EQUAL_WITH(cont.erase(key),1u, (key) );
>>
>> which would say:
>>
>> basics.cpp(61): error in "test_case": check cont.erase(key) == 1u
>> failed [0 != 1] with key == 12
>>
>> Is there a way I could do that? I have tried to ask in #BOOST on
>> IRC, but it seems there are only bots there. :(
>>
>
> Have you looked at
> http://www.boost.org/libs/test/doc/html/utf/testing-tools/custom-predicate.html

I have, but I am looking for a simple solution that would not change the look of the test code too much. That is something I wish to avoid. Especially if it means changing the test asserts to something that needs to be documented and taught to all (150+ people).

Attila


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net