Quick & dirty update of hash tests for new version of Boost.Test

[SVN r32056]
This commit is contained in:
Daniel James
2005-12-15 00:27:53 +00:00
parent dd76eb37ed
commit 985edc9e9c
17 changed files with 31 additions and 31 deletions

View File

@@ -14,12 +14,12 @@
# endif # endif
#endif #endif
#define BOOST_AUTO_TEST_MAIN #define BOOST_TEST_MAIN
#include <boost/test/auto_unit_test.hpp> #include <boost/test/auto_unit_test.hpp>
#ifdef TEST_EXTENSIONS #ifdef TEST_EXTENSIONS
BOOST_AUTO_UNIT_TEST(array_int_test) BOOST_AUTO_TEST_CASE(array_int_test)
{ {
const int length1 = 25; const int length1 = 25;
int array1[25] = { int array1[25] = {
@@ -47,7 +47,7 @@ BOOST_AUTO_UNIT_TEST(array_int_test)
== HASH_NAMESPACE::hash_range(array3, array3 + length3)); == 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}}; int array[3][2] = {{-5, 6}, {7, -3}, {26, 1}};
HASH_NAMESPACE::hash<int[3][2]> hasher; HASH_NAMESPACE::hash<int[3][2]> hasher;

View File

@@ -49,7 +49,7 @@ namespace boost
# endif # endif
#endif #endif
#define BOOST_AUTO_TEST_MAIN #define BOOST_TEST_MAIN
#include <boost/test/auto_unit_test.hpp> #include <boost/test/auto_unit_test.hpp>
#ifdef TEST_EXTENSIONS #ifdef TEST_EXTENSIONS
@@ -58,7 +58,7 @@ namespace boost
#include <string> #include <string>
#include <cctype> #include <cctype>
BOOST_AUTO_UNIT_TEST(custom_tests) BOOST_AUTO_TEST_CASE(custom_tests)
{ {
HASH_NAMESPACE::hash<test::custom> custom_hasher; HASH_NAMESPACE::hash<test::custom> custom_hasher;
BOOST_CHECK(custom_hasher(10) == 100u); BOOST_CHECK(custom_hasher(10) == 100u);

View File

@@ -14,7 +14,7 @@
# endif # endif
#endif #endif
#define BOOST_AUTO_TEST_MAIN #define BOOST_TEST_MAIN
#include <boost/test/auto_unit_test.hpp> #include <boost/test/auto_unit_test.hpp>
#ifdef TEST_EXTENSIONS #ifdef TEST_EXTENSIONS

View File

@@ -11,7 +11,7 @@
# include <boost/functional/hash/hash.hpp> # include <boost/functional/hash/hash.hpp>
#endif #endif
#define BOOST_AUTO_TEST_MAIN #define BOOST_TEST_MAIN
#include <boost/test/auto_unit_test.hpp> #include <boost/test/auto_unit_test.hpp>
#include <cmath> #include <cmath>
@@ -193,7 +193,7 @@ void float_tests(char const* name, T* = 0)
#endif #endif
} }
BOOST_AUTO_UNIT_TEST(hash_float_tests) BOOST_AUTO_TEST_CASE(hash_float_tests)
{ {
std::cout<<"Compiler: "<<BOOST_COMPILER<<"\n"; std::cout<<"Compiler: "<<BOOST_COMPILER<<"\n";
std::cout<<"Platform: "<<BOOST_PLATFORM<<"\n"; std::cout<<"Platform: "<<BOOST_PLATFORM<<"\n";
@@ -202,12 +202,12 @@ BOOST_AUTO_UNIT_TEST(hash_float_tests)
float_tests("float", (float*) 0); float_tests("float", (float*) 0);
} }
BOOST_AUTO_UNIT_TEST(hash_double_tests) BOOST_AUTO_TEST_CASE(hash_double_tests)
{ {
float_tests("double", (double*) 0); 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); float_tests("long double", (long double*) 0);
} }

View File

@@ -12,7 +12,7 @@
# include <boost/functional/hash/hash.hpp> # include <boost/functional/hash/hash.hpp>
#endif #endif
#define BOOST_AUTO_TEST_MAIN #define BOOST_TEST_MAIN
#include <boost/test/auto_unit_test.hpp> #include <boost/test/auto_unit_test.hpp>
#include <boost/limits.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_func1(int) { return 0; }
int int_func2(int) { return 1; } 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((void(**)()) 0);
compile_time_tests((int(**)(int)) 0); compile_time_tests((int(**)(int)) 0);

View File

@@ -14,7 +14,7 @@
# endif # endif
#endif #endif
#define BOOST_AUTO_TEST_MAIN #define BOOST_TEST_MAIN
#include <boost/test/auto_unit_test.hpp> #include <boost/test/auto_unit_test.hpp>
#ifdef TEST_EXTENSIONS #ifdef TEST_EXTENSIONS

View File

@@ -14,7 +14,7 @@
# endif # endif
#endif #endif
#define BOOST_AUTO_TEST_MAIN #define BOOST_TEST_MAIN
#include <boost/test/auto_unit_test.hpp> #include <boost/test/auto_unit_test.hpp>
#include <map> #include <map>

View File

@@ -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<char, unsigned char>*) 0);
integer_tests((CONTAINER_TYPE<int, float>*) 0); integer_tests((CONTAINER_TYPE<int, float>*) 0);

View File

@@ -11,7 +11,7 @@
# include <boost/functional/hash/hash.hpp> # include <boost/functional/hash/hash.hpp>
#endif #endif
#define BOOST_AUTO_TEST_MAIN #define BOOST_TEST_MAIN
#include <boost/test/auto_unit_test.hpp> #include <boost/test/auto_unit_test.hpp>
#include <boost/preprocessor/cat.hpp> #include <boost/preprocessor/cat.hpp>
@@ -106,7 +106,7 @@ void poor_quality_tests(T*)
} }
#define NUMERIC_TEST(type, name) \ #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); \ numeric_test((type*) 0); \
limits_test((type*) 0); \ limits_test((type*) 0); \
poor_quality_tests((type*) 0); \ poor_quality_tests((type*) 0); \

View File

@@ -12,7 +12,7 @@
# include <boost/functional/hash/hash.hpp> # include <boost/functional/hash/hash.hpp>
#endif #endif
#define BOOST_AUTO_TEST_MAIN #define BOOST_TEST_MAIN
#include <boost/test/auto_unit_test.hpp> #include <boost/test/auto_unit_test.hpp>
#include <boost/limits.hpp> #include <boost/limits.hpp>
@@ -21,7 +21,7 @@
#include "./compile_time.hpp" #include "./compile_time.hpp"
BOOST_AUTO_UNIT_TEST(pointer_tests) BOOST_AUTO_TEST_CASE(pointer_tests)
{ {
compile_time_tests((int**) 0); compile_time_tests((int**) 0);
compile_time_tests((void**) 0); compile_time_tests((void**) 0);

View File

@@ -13,7 +13,7 @@
# endif # endif
#endif #endif
#define BOOST_AUTO_TEST_MAIN #define BOOST_TEST_MAIN
#include <boost/test/auto_unit_test.hpp> #include <boost/test/auto_unit_test.hpp>
#ifdef TEST_EXTENSIONS #ifdef TEST_EXTENSIONS
@@ -22,7 +22,7 @@
#include <boost/mpl/assert.hpp> #include <boost/mpl/assert.hpp>
#include <boost/type_traits/is_base_and_derived.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; std::vector<int> empty, values1, values2, values3, values4, values5;
values1.push_back(0); values1.push_back(0);

View File

@@ -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<char>*) 0);
integer_tests((CONTAINER_TYPE<int>*) 0); integer_tests((CONTAINER_TYPE<int>*) 0);

View File

@@ -14,7 +14,7 @@
# endif # endif
#endif #endif
#define BOOST_AUTO_TEST_MAIN #define BOOST_TEST_MAIN
#include <boost/test/auto_unit_test.hpp> #include <boost/test/auto_unit_test.hpp>
#ifdef TEST_EXTENSIONS #ifdef TEST_EXTENSIONS

View File

@@ -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<char>*) 0);
integer_tests((CONTAINER_TYPE<int>*) 0); integer_tests((CONTAINER_TYPE<int>*) 0);

View File

@@ -11,7 +11,7 @@
# include <boost/functional/hash/hash.hpp> # include <boost/functional/hash/hash.hpp>
#endif #endif
#define BOOST_AUTO_TEST_MAIN #define BOOST_TEST_MAIN
#include <boost/test/auto_unit_test.hpp> #include <boost/test/auto_unit_test.hpp>
#include <boost/limits.hpp> #include <boost/limits.hpp>
@@ -20,7 +20,7 @@
#include "./compile_time.hpp" #include "./compile_time.hpp"
BOOST_AUTO_UNIT_TEST(string_tests) BOOST_AUTO_TEST_CASE(string_tests)
{ {
compile_time_tests((std::string*) 0); compile_time_tests((std::string*) 0);
@@ -44,7 +44,7 @@ BOOST_AUTO_UNIT_TEST(string_tests)
} }
#if !defined(BOOST_NO_STD_WSTRING) #if !defined(BOOST_NO_STD_WSTRING)
BOOST_AUTO_UNIT_TEST(wstring_tests) BOOST_AUTO_TEST_CASE(wstring_tests)
{ {
compile_time_tests((std::wstring*) 0); compile_time_tests((std::wstring*) 0);

View File

@@ -17,12 +17,12 @@
# endif # endif
#endif #endif
#define BOOST_AUTO_TEST_MAIN #define BOOST_TEST_MAIN
#include <boost/test/auto_unit_test.hpp> #include <boost/test/auto_unit_test.hpp>
#ifdef TEST_EXTENSIONS #ifdef TEST_EXTENSIONS
BOOST_AUTO_UNIT_TEST(array_int_test) BOOST_AUTO_TEST_CASE(array_int_test)
{ {
const int array1[25] = { const int array1[25] = {
26, -43, 32, 65, 45, 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_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}}; int array[3][2] = {{-5, 6}, {7, -3}, {26, 1}};
HASH_NAMESPACE::hash<int[3][2]> hasher; HASH_NAMESPACE::hash<int[3][2]> hasher;

View File

@@ -14,7 +14,7 @@
# endif # endif
#endif #endif
#define BOOST_AUTO_TEST_MAIN #define BOOST_TEST_MAIN
#include <boost/test/auto_unit_test.hpp> #include <boost/test/auto_unit_test.hpp>
#ifdef TEST_EXTENSIONS #ifdef TEST_EXTENSIONS