From 6534cfbf370b962cab20e2d91d2dc331d728d017 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Fri, 24 Aug 2007 02:33:43 +0000 Subject: [PATCH] Remove hash_complex_test - it should have been removed when I reverted to 1.34.1 [SVN r38884] --- hash/test/hash_complex_test.cpp | 108 -------------------------------- 1 file changed, 108 deletions(-) delete mode 100644 hash/test/hash_complex_test.cpp diff --git a/hash/test/hash_complex_test.cpp b/hash/test/hash_complex_test.cpp deleted file mode 100644 index a0707b5..0000000 --- a/hash/test/hash_complex_test.cpp +++ /dev/null @@ -1,108 +0,0 @@ - -// Copyright 2005-2007 Daniel James. -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -#include "./config.hpp" - -#ifdef TEST_EXTENSIONS -# ifdef TEST_STD_INCLUDES -# include -# else -# include -# endif -#endif - -#include - -#ifdef TEST_EXTENSIONS - -#include -#include -#include - -#if defined(BOOST_MSVC) -#pragma warning(push) -#pragma warning(disable:4244) // conversion from 'unsigned long' to 'unsigned short', possible loss of data -#pragma warning(disable:4512) // assignment operator could not be generated -#endif - -#include -#include -#include -#include - -#if defined(BOOST_MSVC) -#pragma warning(pop) -#endif - -template -void generic_complex_tests(std::complex v) -{ - HASH_NAMESPACE::hash > complex_hasher; - - BOOST_TEST(complex_hasher(v) == complex_hasher(v)); - - HASH_NAMESPACE::hash real_hasher; - T real = v.real(); - T imag = v.imag(); - - BOOST_TEST(real_hasher(real) == complex_hasher(std::complex(real))); - - if(imag != 0 && real_hasher(real) == complex_hasher(v)) { - std::ostringstream os; - os<<"real_hasher("< -void complex_float_tests(Float*) -{ - boost::mt19937 rng; - boost::uniform_real uniform; - boost::variate_generator > - uniform_generator(rng, uniform); - - for(int i = 0; i < 100; ++i) - { - std::complex v(uniform_generator(), uniform_generator()); - generic_complex_tests(v); - } -} - -template -void complex_integral_tests(Integer*) -{ - boost::mt19937 rng; - boost::uniform_int uniform( - (std::numeric_limits::min)(), - (std::numeric_limits::max)()); - boost::variate_generator > - uniform_generator(rng, uniform); - - for(int i = 0; i < 100; ++i) - { - std::complexv(uniform_generator(), uniform_generator()); - generic_complex_tests(v); - } -} - -int main() -{ - complex_float_tests((float*) 0); - complex_float_tests((double*) 0); - complex_float_tests((long double*) 0); - complex_integral_tests((short*) 0); - complex_integral_tests((int*) 0); - complex_integral_tests((long*) 0); - complex_integral_tests((unsigned short*) 0); - complex_integral_tests((unsigned int*) 0); - complex_integral_tests((unsigned long*) 0); - - return boost::report_errors(); -} - -#endif