incubator-stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Sebor <se...@roguewave.com>
Subject Re: test for lib.alg.merge
Date Mon, 06 Feb 2006 23:55:04 GMT
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

Mime
View raw message