Change the hash tests to use the lightweight test header.

[SVN r32784]
This commit is contained in:
Daniel James
2006-02-09 19:16:08 +00:00
parent 514757c312
commit 4bee159a10
23 changed files with 412 additions and 273 deletions
+15 -8
View File
@@ -49,8 +49,7 @@ namespace boost
# endif
#endif
#define BOOST_TEST_MAIN
#include <boost/test/unit_test.hpp>
#include <boost/detail/lightweight_test.hpp>
#ifdef TEST_EXTENSIONS
@@ -58,16 +57,16 @@ namespace boost
#include <string>
#include <cctype>
BOOST_AUTO_TEST_CASE(custom_tests)
void custom_tests()
{
HASH_NAMESPACE::hash<test::custom> custom_hasher;
BOOST_CHECK(custom_hasher(10) == 100u);
BOOST_TEST(custom_hasher(10) == 100u);
test::custom x(55);
BOOST_CHECK(custom_hasher(x) == 550u);
BOOST_TEST(custom_hasher(x) == 550u);
{
using namespace HASH_NAMESPACE;
BOOST_CHECK(custom_hasher(x) == hash_value(x));
BOOST_TEST(custom_hasher(x) == hash_value(x));
}
std::vector<test::custom> custom_vector;
@@ -85,9 +84,17 @@ BOOST_AUTO_TEST_CASE(custom_tests)
HASH_NAMESPACE::hash_combine(seed2, 250u);
HASH_NAMESPACE::hash_combine(seed2, 350u);
BOOST_CHECK(seed ==
BOOST_TEST(seed ==
HASH_NAMESPACE::hash_range(custom_vector.begin(), custom_vector.end()));
BOOST_CHECK(seed == seed2);
BOOST_TEST(seed == seed2);
}
#endif // TEST_EXTENSIONS
int main()
{
#ifdef TEST_EXTENSIONS
custom_tests();
#endif
return boost::report_errors();
}