|
Boost-Commit : |
From: daniel_james_at_[hidden]
Date: 2007-08-27 14:13:46
Author: danieljames
Date: 2007-08-27 14:13:45 EDT (Mon, 27 Aug 2007)
New Revision: 39013
URL: http://svn.boost.org/trac/boost/changeset/39013
Log:
Better test for hash(-5).
Text files modified:
branches/hash/libs/functional/hash/test/hash_number_test.cpp | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
Modified: branches/hash/libs/functional/hash/test/hash_number_test.cpp
==============================================================================
--- branches/hash/libs/functional/hash/test/hash_number_test.cpp (original)
+++ branches/hash/libs/functional/hash/test/hash_number_test.cpp 2007-08-27 14:13:45 EDT (Mon, 27 Aug 2007)
@@ -55,8 +55,8 @@
if (limits::is_integer)
{
- BOOST_TEST(HASH_NAMESPACE::hash_value(T((std::size_t)-5))
- == (std::size_t)T(-5));
+ if(limits::is_signed || limits::digits <= boost::hash_detail::numeric_limits<std::size_t>::digits)
+ BOOST_TEST(HASH_NAMESPACE::hash_value(T(-5)) == (std::size_t)T(-5));
BOOST_TEST(HASH_NAMESPACE::hash_value(T(0)) == (std::size_t)T(0u));
BOOST_TEST(HASH_NAMESPACE::hash_value(T(10)) == (std::size_t)T(10u));
BOOST_TEST(HASH_NAMESPACE::hash_value(T(25)) == (std::size_t)T(25u));
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