stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Sebor <>
Subject Re: test for lib.alg.random_shuffle
Date Thu, 26 Jan 2006 03:05:11 GMT
Anton Pevtsov wrote:
> The attached file contains my attempt to update lib.alg.random_shuffle
> tests and port it to new test driver.

Thank you!

I tightened it up a bit (maybe more than a bit ;-) and exposed
strict conformance bug in the algorithm -- see STDCXX-126:
I fixed the bug with the following change and committed the test
with the change below:
and then fixed bugs I introduced with this one:

Btw., I noticed that that the test function is parametrized
unnecessarily. I don't think it needs to be a template at all.
AFAICS, it is being instantiated with just one set of template
arguments. I think it would simplify the test (and might make
it compile faster) if we made it an ordinary function. Could
you look into it?

> Martin Sebor wrote:
>  >> Not sure what you mean here.
> [...]
>  >> I'm not seeing any runtime problems with the test and I'm not sure I
>  >> understand where you think the problem is.
> The possible problem is that this test case may be passed when the "nloops"
> parameter is set to 1024 (default value) only.
> The cause is the hardcoded array with values corresponding to 1025
> invocation of the random_shuffle (values in the array corresponds to
> 1025-th permutation).
> I left this test case as is, but may be it will be more convenient to
> hardcode first permutation results to avoid any dependecy on count of
> previous random_shuffle calls?
> Or we can disable the "nloops" parameter at all.

Hmm. We need to look into this -- I'm seeing one failure with the
latest test even with no options.


View raw message