Seed the random number generator in tests.

[SVN r41782]
This commit is contained in:
Daniel James
2007-12-06 11:42:28 +00:00
parent 322f7d6ec6
commit 6e8f9e1c67
18 changed files with 41 additions and 2 deletions

View File

@@ -7,8 +7,6 @@
// Which is not good as different platforms will be running different tests.
// It would be much better to use Boost.Random, but it doesn't
// support all the compilers that I want to test on.
// TODO: seed the random generator.
// TODO: check that this is actually working...
#if !defined(BOOST_UNORDERED_TEST_HELPERS_GENERATORS_HEADER)
#define BOOST_UNORDERED_TEST_HELPERS_GENERATORS_HEADER
@@ -22,6 +20,13 @@
namespace test
{
struct seed_t {
seed_t(unsigned int x) {
using namespace std;
srand(x);
}
};
template <class T>
struct generator;