Boost logo

Boost :

From: Thomas Matelich (sosedada_at_[hidden])
Date: 2001-07-10 12:06:40


jpanzer_at_[hidden] wrote:

> Are there any unit tests for functors in the works for the Boost test
> library? Specifically, to test whether they really meet complex
> requirements, such as strict weak ordering, for a given set of inputs?
> This is something that static concept checking clearly can't do, but
> it's important to get right, and I think it's expensive or impossible
> for library code to try to validate such requirements.
>
> I don't see anything like this in the current beta or published
> libraries. The Boost Test Library looks like a good platform to build
> such a thing on top of, though.
>
> Motivation: Recently an engineer in my group tracked down a mysterious
> random crash problem to a bug in the comparison predicate used with a
> map<> container. Unfortunately this was my code :^). I would love to
> be able to write, as part of my unit test, something like this:
>
> test_functor_concept<StrictWeakOrdering>(MyLessThan(),
> ArgumentGenerator());
>
> where I supply the functor (MyLessThan) and a generator functor that
> creates test objects in a reproducible way for use by the test harness.
> Perhaps a third argument specifying the amount of time to spend on the
> testing would be useful. Anything like this already out there?
>
> If not, and people think it useful, I might write it myself. Please let
> me know what you think.

I'm having trouble picturing how it would work, but it sounds useful. I'd be happy to
review any code you come up with.

On a side note, it has been a while since anyone pestered Beman about Boost.Test. How
is that coming, esp. regarding the unit test framework?

--
Thomas O Matelich
Senior Software Designer
Zetec, Inc.
sosedada_at_[hidden]
tmatelich_at_[hidden]

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk