mirror of
https://github.com/boostorg/functional.git
synced 2025-08-01 21:44:28 +02:00
Quick & dirty update of hash tests for new version of Boost.Test
[SVN r32056]
This commit is contained in:
@@ -14,12 +14,12 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#define BOOST_AUTO_TEST_MAIN
|
||||
#define BOOST_TEST_MAIN
|
||||
#include <boost/test/auto_unit_test.hpp>
|
||||
|
||||
#ifdef TEST_EXTENSIONS
|
||||
|
||||
BOOST_AUTO_UNIT_TEST(array_int_test)
|
||||
BOOST_AUTO_TEST_CASE(array_int_test)
|
||||
{
|
||||
const int length1 = 25;
|
||||
int array1[25] = {
|
||||
@@ -47,7 +47,7 @@ BOOST_AUTO_UNIT_TEST(array_int_test)
|
||||
== HASH_NAMESPACE::hash_range(array3, array3 + length3));
|
||||
}
|
||||
|
||||
BOOST_AUTO_UNIT_TEST(two_dimensional_array_test)
|
||||
BOOST_AUTO_TEST_CASE(two_dimensional_array_test)
|
||||
{
|
||||
int array[3][2] = {{-5, 6}, {7, -3}, {26, 1}};
|
||||
HASH_NAMESPACE::hash<int[3][2]> hasher;
|
||||
|
@@ -49,7 +49,7 @@ namespace boost
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#define BOOST_AUTO_TEST_MAIN
|
||||
#define BOOST_TEST_MAIN
|
||||
#include <boost/test/auto_unit_test.hpp>
|
||||
|
||||
#ifdef TEST_EXTENSIONS
|
||||
@@ -58,7 +58,7 @@ namespace boost
|
||||
#include <string>
|
||||
#include <cctype>
|
||||
|
||||
BOOST_AUTO_UNIT_TEST(custom_tests)
|
||||
BOOST_AUTO_TEST_CASE(custom_tests)
|
||||
{
|
||||
HASH_NAMESPACE::hash<test::custom> custom_hasher;
|
||||
BOOST_CHECK(custom_hasher(10) == 100u);
|
||||
|
@@ -14,7 +14,7 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#define BOOST_AUTO_TEST_MAIN
|
||||
#define BOOST_TEST_MAIN
|
||||
#include <boost/test/auto_unit_test.hpp>
|
||||
|
||||
#ifdef TEST_EXTENSIONS
|
||||
|
@@ -11,7 +11,7 @@
|
||||
# include <boost/functional/hash/hash.hpp>
|
||||
#endif
|
||||
|
||||
#define BOOST_AUTO_TEST_MAIN
|
||||
#define BOOST_TEST_MAIN
|
||||
#include <boost/test/auto_unit_test.hpp>
|
||||
|
||||
#include <cmath>
|
||||
@@ -193,7 +193,7 @@ void float_tests(char const* name, T* = 0)
|
||||
#endif
|
||||
}
|
||||
|
||||
BOOST_AUTO_UNIT_TEST(hash_float_tests)
|
||||
BOOST_AUTO_TEST_CASE(hash_float_tests)
|
||||
{
|
||||
std::cout<<"Compiler: "<<BOOST_COMPILER<<"\n";
|
||||
std::cout<<"Platform: "<<BOOST_PLATFORM<<"\n";
|
||||
@@ -202,12 +202,12 @@ BOOST_AUTO_UNIT_TEST(hash_float_tests)
|
||||
float_tests("float", (float*) 0);
|
||||
}
|
||||
|
||||
BOOST_AUTO_UNIT_TEST(hash_double_tests)
|
||||
BOOST_AUTO_TEST_CASE(hash_double_tests)
|
||||
{
|
||||
float_tests("double", (double*) 0);
|
||||
}
|
||||
|
||||
BOOST_AUTO_UNIT_TEST(hash_long_double_tests)
|
||||
BOOST_AUTO_TEST_CASE(hash_long_double_tests)
|
||||
{
|
||||
float_tests("long double", (long double*) 0);
|
||||
}
|
||||
|
@@ -12,7 +12,7 @@
|
||||
# include <boost/functional/hash/hash.hpp>
|
||||
#endif
|
||||
|
||||
#define BOOST_AUTO_TEST_MAIN
|
||||
#define BOOST_TEST_MAIN
|
||||
#include <boost/test/auto_unit_test.hpp>
|
||||
|
||||
#include <boost/limits.hpp>
|
||||
@@ -26,7 +26,7 @@ void void_func2() { static int x = 2; --x; }
|
||||
int int_func1(int) { return 0; }
|
||||
int int_func2(int) { return 1; }
|
||||
|
||||
BOOST_AUTO_UNIT_TEST(function_pointer_tests)
|
||||
BOOST_AUTO_TEST_CASE(function_pointer_tests)
|
||||
{
|
||||
compile_time_tests((void(**)()) 0);
|
||||
compile_time_tests((int(**)(int)) 0);
|
||||
|
@@ -14,7 +14,7 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#define BOOST_AUTO_TEST_MAIN
|
||||
#define BOOST_TEST_MAIN
|
||||
#include <boost/test/auto_unit_test.hpp>
|
||||
|
||||
#ifdef TEST_EXTENSIONS
|
||||
|
@@ -14,7 +14,7 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#define BOOST_AUTO_TEST_MAIN
|
||||
#define BOOST_TEST_MAIN
|
||||
#include <boost/test/auto_unit_test.hpp>
|
||||
|
||||
#include <map>
|
||||
|
@@ -52,7 +52,7 @@ namespace BOOST_PP_CAT(CONTAINER_TYPE, _tests)
|
||||
}
|
||||
}
|
||||
|
||||
BOOST_AUTO_UNIT_TEST(BOOST_PP_CAT(CONTAINER_TYPE, _hash_integer_tests))
|
||||
BOOST_AUTO_TEST_CASE(BOOST_PP_CAT(CONTAINER_TYPE, _hash_integer_tests))
|
||||
{
|
||||
integer_tests((CONTAINER_TYPE<char, unsigned char>*) 0);
|
||||
integer_tests((CONTAINER_TYPE<int, float>*) 0);
|
||||
|
@@ -11,7 +11,7 @@
|
||||
# include <boost/functional/hash/hash.hpp>
|
||||
#endif
|
||||
|
||||
#define BOOST_AUTO_TEST_MAIN
|
||||
#define BOOST_TEST_MAIN
|
||||
#include <boost/test/auto_unit_test.hpp>
|
||||
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
@@ -106,7 +106,7 @@ void poor_quality_tests(T*)
|
||||
}
|
||||
|
||||
#define NUMERIC_TEST(type, name) \
|
||||
BOOST_AUTO_UNIT_TEST(BOOST_PP_CAT(test_, name)) { \
|
||||
BOOST_AUTO_TEST_CASE(BOOST_PP_CAT(test_, name)) { \
|
||||
numeric_test((type*) 0); \
|
||||
limits_test((type*) 0); \
|
||||
poor_quality_tests((type*) 0); \
|
||||
|
@@ -12,7 +12,7 @@
|
||||
# include <boost/functional/hash/hash.hpp>
|
||||
#endif
|
||||
|
||||
#define BOOST_AUTO_TEST_MAIN
|
||||
#define BOOST_TEST_MAIN
|
||||
#include <boost/test/auto_unit_test.hpp>
|
||||
|
||||
#include <boost/limits.hpp>
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
#include "./compile_time.hpp"
|
||||
|
||||
BOOST_AUTO_UNIT_TEST(pointer_tests)
|
||||
BOOST_AUTO_TEST_CASE(pointer_tests)
|
||||
{
|
||||
compile_time_tests((int**) 0);
|
||||
compile_time_tests((void**) 0);
|
||||
|
@@ -13,7 +13,7 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#define BOOST_AUTO_TEST_MAIN
|
||||
#define BOOST_TEST_MAIN
|
||||
#include <boost/test/auto_unit_test.hpp>
|
||||
|
||||
#ifdef TEST_EXTENSIONS
|
||||
@@ -22,7 +22,7 @@
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <boost/type_traits/is_base_and_derived.hpp>
|
||||
|
||||
BOOST_AUTO_UNIT_TEST(hash_range_tests)
|
||||
BOOST_AUTO_TEST_CASE(hash_range_tests)
|
||||
{
|
||||
std::vector<int> empty, values1, values2, values3, values4, values5;
|
||||
values1.push_back(0);
|
||||
|
@@ -55,7 +55,7 @@ namespace BOOST_PP_CAT(CONTAINER_TYPE, _tests)
|
||||
}
|
||||
}
|
||||
|
||||
BOOST_AUTO_UNIT_TEST(BOOST_PP_CAT(CONTAINER_TYPE, _hash_integer_tests))
|
||||
BOOST_AUTO_TEST_CASE(BOOST_PP_CAT(CONTAINER_TYPE, _hash_integer_tests))
|
||||
{
|
||||
integer_tests((CONTAINER_TYPE<char>*) 0);
|
||||
integer_tests((CONTAINER_TYPE<int>*) 0);
|
||||
|
@@ -14,7 +14,7 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#define BOOST_AUTO_TEST_MAIN
|
||||
#define BOOST_TEST_MAIN
|
||||
#include <boost/test/auto_unit_test.hpp>
|
||||
|
||||
#ifdef TEST_EXTENSIONS
|
||||
|
@@ -53,7 +53,7 @@ namespace BOOST_PP_CAT(CONTAINER_TYPE, _tests)
|
||||
}
|
||||
}
|
||||
|
||||
BOOST_AUTO_UNIT_TEST(BOOST_PP_CAT(CONTAINER_TYPE, _hash_integer_tests))
|
||||
BOOST_AUTO_TEST_CASE(BOOST_PP_CAT(CONTAINER_TYPE, _hash_integer_tests))
|
||||
{
|
||||
integer_tests((CONTAINER_TYPE<char>*) 0);
|
||||
integer_tests((CONTAINER_TYPE<int>*) 0);
|
||||
|
@@ -11,7 +11,7 @@
|
||||
# include <boost/functional/hash/hash.hpp>
|
||||
#endif
|
||||
|
||||
#define BOOST_AUTO_TEST_MAIN
|
||||
#define BOOST_TEST_MAIN
|
||||
#include <boost/test/auto_unit_test.hpp>
|
||||
|
||||
#include <boost/limits.hpp>
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
#include "./compile_time.hpp"
|
||||
|
||||
BOOST_AUTO_UNIT_TEST(string_tests)
|
||||
BOOST_AUTO_TEST_CASE(string_tests)
|
||||
{
|
||||
compile_time_tests((std::string*) 0);
|
||||
|
||||
@@ -44,7 +44,7 @@ BOOST_AUTO_UNIT_TEST(string_tests)
|
||||
}
|
||||
|
||||
#if !defined(BOOST_NO_STD_WSTRING)
|
||||
BOOST_AUTO_UNIT_TEST(wstring_tests)
|
||||
BOOST_AUTO_TEST_CASE(wstring_tests)
|
||||
{
|
||||
compile_time_tests((std::wstring*) 0);
|
||||
|
||||
|
@@ -17,12 +17,12 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#define BOOST_AUTO_TEST_MAIN
|
||||
#define BOOST_TEST_MAIN
|
||||
#include <boost/test/auto_unit_test.hpp>
|
||||
|
||||
#ifdef TEST_EXTENSIONS
|
||||
|
||||
BOOST_AUTO_UNIT_TEST(array_int_test)
|
||||
BOOST_AUTO_TEST_CASE(array_int_test)
|
||||
{
|
||||
const int array1[25] = {
|
||||
26, -43, 32, 65, 45,
|
||||
@@ -44,7 +44,7 @@ BOOST_AUTO_UNIT_TEST(array_int_test)
|
||||
BOOST_CHECK(hasher3(array3) == HASH_NAMESPACE::hash_value(array3));
|
||||
}
|
||||
|
||||
BOOST_AUTO_UNIT_TEST(two_dimensional_array_test)
|
||||
BOOST_AUTO_TEST_CASE(two_dimensional_array_test)
|
||||
{
|
||||
int array[3][2] = {{-5, 6}, {7, -3}, {26, 1}};
|
||||
HASH_NAMESPACE::hash<int[3][2]> hasher;
|
||||
|
@@ -14,7 +14,7 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#define BOOST_AUTO_TEST_MAIN
|
||||
#define BOOST_TEST_MAIN
|
||||
#include <boost/test/auto_unit_test.hpp>
|
||||
|
||||
#ifdef TEST_EXTENSIONS
|
||||
|
Reference in New Issue
Block a user