You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stdcxx.apache.org by Anton Pevtsov <an...@moscow.vdiweb.com> on 2006/02/06 17:24:30 UTC

test for lib.alg.merge

The attached file contains the tests for the lib.alg.merge algorithm.

With best wishes,
Anton Pevtsov


Re: test for lib.alg.merge

Posted by Martin Sebor <se...@roguewave.com>.
Anton Pevtsov wrote:
> The attached file contains the tests for the lib.alg.merge algorithm.

Okay, thanks. I'll trust you that the test does the right thing :)
Committed thus: http://svn.apache.org/viewcvs.cgi?rev=375412&view=rev

Btw., the StrictWeakLess functor (that I took the liberty to rename
to just Less) is probably going to be usable in other tests, no? If
so, we should move it to alg_test.h.

Incidentally, the test takes very long to compile (see the times below
for gcc 4.0.2 on a 400 MHz Solaris 9/SPARC). I suspect it's because of
the large number of instantiations of the test function. It would be
nice to do something about it. One idea might be factor all the code
that inevitably must be iterator- and algorithm-specific to a small
helper template derived from an ordinary (non-template) base class,
construct an object of the appropriate derived type in the function
that sets up all the template arguments (i.e., the types of the
iterators and the algorithm to test), and pass this object by
reference to the base class to the test function.

The timing:
   real    1m34.767s
   user    1m30.590s
   sys     0m2.280s


> 
...
> /***************************************************************************
>  *
>  * sort.cpp - test exercising 25.3.1-3 [lib.alg.sort]

Please remember to change this comment when copying from an existing
test :)

Martin