stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Sebor <>
Subject question about 25.for.each.cpp (was Re: Stdcxx test porting)
Date Mon, 21 Nov 2005 17:59:53 GMT
Anton Pevtsov wrote:
> Martin,
> Btw, I have a question about the for_each algorithm test. Shall we test
> this algorithm in additional with InputIterator? Actually we test it
> with Forward, Bidirectional and Random Access iterators, but as far as I
> know the for_each algorithm requires InputIterator.

Yes, we should, eventually. Good catch!

I'm fine with you just porting the test as they are, or with enhancing
them at the same as we're discussing. I think doing both in one go might
be less time-consuming than porting them first and then coming back to
them and enhancing them.

In addition, while you're doing the porting I would encourage you
to think about how to improve and simplify the tests even further.

For instance, the for.each test isn't quite as exhaustive as it should
be (the function object isn't being sufficiently exercised), nor does
it readily lend itself to being enhanced to be (ditto for the equal
test). I think the adjacent.find test is structured much better (with
one test case per line) and would eventually like to rewrite the other
tests along the same lines.

Another example of where the tests could be improved is the amount of
boilerplate code required to set them up (the run_tests function and
all the invocations of the specializations of the test function). It
would be nice to reduce this overhead by getting the test driver to
do all of this work and have the test just provide the data (i.e.,
the addresses of the functions and the names of the command line
arguments to enable/disable them).


View raw message