|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r53924 - trunk/libs/functional/hash/test
From: daniel_james_at_[hidden]
Date: 2009-06-15 03:37:43
Author: danieljames
Date: 2009-06-15 03:37:42 EDT (Mon, 15 Jun 2009)
New Revision: 53924
URL: http://svn.boost.org/trac/boost/changeset/53924
Log:
Remove hash_complex_test's dependency on Boost.Random.
Only test for a few values, but that should be okay as there isn't much
to test.
Text files modified:
trunk/libs/functional/hash/test/hash_complex_test.cpp | 40 +++++++++++++---------------------------
1 files changed, 13 insertions(+), 27 deletions(-)
Modified: trunk/libs/functional/hash/test/hash_complex_test.cpp
==============================================================================
--- trunk/libs/functional/hash/test/hash_complex_test.cpp (original)
+++ trunk/libs/functional/hash/test/hash_complex_test.cpp 2009-06-15 03:37:42 EDT (Mon, 15 Jun 2009)
@@ -27,11 +27,6 @@
#pragma warning(disable:4512) // assignment operator could not be generated
#endif
-#include <boost/random/mersenne_twister.hpp>
-#include <boost/random/uniform_int.hpp>
-#include <boost/random/uniform_real.hpp>
-#include <boost/random/variate_generator.hpp>
-
#if defined(BOOST_MSVC)
#pragma warning(pop)
#endif
@@ -61,33 +56,24 @@
template <class Float>
void complex_float_tests(Float*)
{
- boost::mt19937 rng;
- boost::uniform_real<Float> uniform;
- boost::variate_generator<boost::mt19937&, boost::uniform_real<Float> >
- uniform_generator(rng, uniform);
-
- for(int i = 0; i < 100; ++i)
- {
- std::complex<Float> v(uniform_generator(), uniform_generator());
- generic_complex_tests(v);
- }
+ typedef std::complex<Float> complex;
+ generic_complex_tests(complex(0,0));
+ generic_complex_tests(complex(0.5,0));
+ generic_complex_tests(complex(25,0));
+ generic_complex_tests(complex(25,0));
+ generic_complex_tests(complex(-67.5324535,56.23578678));
}
template <class Integer>
void complex_integral_tests(Integer*)
{
- boost::mt19937 rng;
- boost::uniform_int<Integer> uniform(
- (std::numeric_limits<Integer>::min)(),
- (std::numeric_limits<Integer>::max)());
- boost::variate_generator<boost::mt19937&, boost::uniform_int<Integer> >
- uniform_generator(rng, uniform);
-
- for(int i = 0; i < 100; ++i)
- {
- std::complex<Integer>v(uniform_generator(), uniform_generator());
- generic_complex_tests(v);
- }
+ typedef std::complex<Integer> complex;
+ generic_complex_tests(complex(0,0));
+ generic_complex_tests(complex(15342,124));
+ generic_complex_tests(complex(25,54356));
+ generic_complex_tests(complex(5325,2346));
+ generic_complex_tests(complex(-243897,-49923874));
+ generic_complex_tests(complex(-543,763));
}
int main()
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk