[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lmi] Relaxing BOOST_TEST_THROW() message test to do substring match
Re: [lmi] Relaxing BOOST_TEST_THROW() message test to do substring match only
Fri, 19 Feb 2016 15:46:48 +0100
On Thu, 18 Feb 2016 13:54:43 +0000 Greg Chicares <address@hidden> wrote:
GC> On 2016-02-18 13:03, Vadim Zeitlin wrote:
GC> > Another one would be to make the third argument of the existing macro an
GC> > object of some exception_message_matcher type. Such object would be
GC> > implicitly constructible from string and would match exactly in this case,
GC> > for compatibility, but it could also be constructed using some
GC> > match_substring() factory function which would create an object matching
GC> > I'd like it to.
GC> > The second approach is slightly more complicated but more flexible (e.g.
GC> > we could easily extend it to support regex matching in the future) and
GC> > avoids the need to agonize over the macro naming decision, so I prefer it.
GC> > The main problem with it from your point of view is probably that it's
GC> > intrusive, i.e. it requires changes to the existing code instead of being
GC> > pure addition as the first one.
GC> How intrusive? Would the second approach require changing 'test_tools.hpp'
Yes. Please find attached the patch implementing this proposal in the
least intrusive and simplest way I could find. It's not urgent per se, but
I'd really like this to be applied to master before the table_tool code is
merged as its tests now use this match_substr().
I think the changes should be rather self-explanatory, but, of course,
please let me know if you have any questions about them. And I've tested
them by running "make unit_tests" which seemed[*] to work fine.
Thanks in advance,
[*] I'm always a bit apprehensive with this make target, it gives so much
output that it's quite easy to miss some error in it -- but the exit
code was 0, at least.
Description: Text document