forked from boostorg/type_traits
modified to use boost test runtime environment
[SVN r9992]
This commit is contained in:
@ -6,6 +6,7 @@
|
||||
|
||||
#include <boost/type_traits/alignment_traits.hpp>
|
||||
#include <boost/utility.hpp>
|
||||
#include <boost/test/cpp_main.cpp>
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hrdstop
|
||||
@ -14,7 +15,7 @@
|
||||
|
||||
NESTED_DECL(alignment_of)
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
int cpp_main(int argc, char* argv[])
|
||||
{
|
||||
NESTED_TEST(alignment_of, int)
|
||||
NESTED_TEST(alignment_of, int_constructible)
|
||||
|
@ -5,6 +5,7 @@
|
||||
// warranty, and with no claim as to its suitability for any purpose.
|
||||
|
||||
#include <boost/type_traits/arithmetic_traits.hpp>
|
||||
#include <boost/test/cpp_main.cpp>
|
||||
#include <boost/utility.hpp>
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
@ -18,7 +19,7 @@ NESTED_DECL(is_float)
|
||||
NESTED_DECL(is_arithmetic)
|
||||
NESTED_DECL(is_fundamental)
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
int cpp_main(int argc, char* argv[])
|
||||
{
|
||||
NESTED_TEST(is_void, void)
|
||||
NESTED_TEST(is_void, int)
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
#include <boost/type_traits/composite_traits.hpp>
|
||||
#include <boost/utility.hpp>
|
||||
#include <boost/test/cpp_main.cpp>
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hrdstop
|
||||
@ -16,7 +17,7 @@ NESTED_DECL(is_array)
|
||||
NESTED_DECL(is_pointer)
|
||||
NESTED_DECL(is_reference)
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
int cpp_main(int argc, char* argv[])
|
||||
{
|
||||
NESTED_TEST(is_array, int)
|
||||
NESTED_TEST(is_array, int[2])
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
#include <boost/type_traits/cv_traits.hpp>
|
||||
#include <boost/utility.hpp>
|
||||
#include <boost/test/cpp_main.cpp>
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hrdstop
|
||||
@ -15,7 +16,7 @@
|
||||
NESTED_DECL(is_const)
|
||||
NESTED_DECL(is_volatile)
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
int cpp_main(int argc, char* argv[])
|
||||
{
|
||||
NESTED_TEST(is_const, int)
|
||||
NESTED_TEST(is_const, const int)
|
||||
|
@ -6,10 +6,11 @@
|
||||
|
||||
#include <boost/type_traits/conversion_traits.hpp>
|
||||
#include <boost/utility.hpp>
|
||||
#include <boost/test/cpp_main.cpp>
|
||||
#include "boost/type_traits/type_traits_test.hpp"
|
||||
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
int cpp_main(int argc, char* argv[])
|
||||
{
|
||||
value_test(true, (boost::is_convertible<Deriverd,Base>::value));
|
||||
value_test(true, (boost::is_convertible<Deriverd,Deriverd>::value));
|
||||
|
@ -5,23 +5,42 @@
|
||||
// warranty, and with no claim as to its suitability for any purpose.
|
||||
|
||||
#include <boost/type_traits.hpp>
|
||||
#include <boost/test/cpp_main.cpp>
|
||||
#include "boost/type_traits/type_traits_test.hpp"
|
||||
|
||||
template <class T>
|
||||
#if !defined(__BORLANDC__) && !defined(__sgi) && !defined(__DECCXX)
|
||||
void is_function_test(T& foo)
|
||||
#else
|
||||
void is_function_test(const T& foo)
|
||||
#endif
|
||||
struct is_function_tester
|
||||
{
|
||||
value_test(true, ::boost::is_function<T>::value);
|
||||
static void check();
|
||||
};
|
||||
|
||||
template <class T>
|
||||
void is_function_tester<T>::check()
|
||||
{
|
||||
if(false == ::boost::is_function<T>::value)
|
||||
{
|
||||
// if we're not a function then we must be a
|
||||
// function pointer:
|
||||
value_test(false, ::boost::is_function<T>::value);
|
||||
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
||||
value_test(true, ::boost::is_pointer<T>::value);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
// if we're a function then we must not be a
|
||||
// function pointer:
|
||||
value_test(true, ::boost::is_function<T>::value);
|
||||
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
||||
value_test(false, ::boost::is_pointer<T>::value);
|
||||
#endif
|
||||
}
|
||||
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
||||
value_test(false, ::boost::is_void<T>::value);
|
||||
value_test(false, ::boost::is_integral<T>::value);
|
||||
value_test(false, ::boost::is_float<T>::value);
|
||||
value_test(false, ::boost::is_arithmetic<T>::value);
|
||||
value_test(false, ::boost::is_fundamental<T>::value);
|
||||
value_test(false, ::boost::is_pointer<T>::value);
|
||||
value_test(false, ::boost::is_reference<T>::value);
|
||||
value_test(false, ::boost::is_member_pointer<T>::value);
|
||||
value_test(false, ::boost::is_enum<T>::value);
|
||||
@ -39,6 +58,20 @@ void is_function_test(const T& foo)
|
||||
#endif
|
||||
}
|
||||
|
||||
template <class T>
|
||||
void is_function_test(T& foo)
|
||||
{
|
||||
is_function_tester<T>::check();
|
||||
}
|
||||
#ifndef BOOST_MSVC
|
||||
template <class T>
|
||||
void is_function_test(const T& foo)
|
||||
{
|
||||
is_function_tester<T>::check();
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
void foo0(){}
|
||||
void foo1(int){}
|
||||
void foo2(int&, double){}
|
||||
@ -46,7 +79,7 @@ void foo3(int&, bool, int, int){}
|
||||
void foo4(int, bool, int*, int[], int, int, int, int, int){}
|
||||
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
int cpp_main(int argc, char* argv[])
|
||||
{
|
||||
is_function_test(foo0);
|
||||
is_function_test(foo1);
|
||||
|
@ -6,13 +6,14 @@
|
||||
|
||||
#include <boost/type_traits/same_traits.hpp>
|
||||
#include <boost/utility.hpp>
|
||||
#include <boost/test/cpp_main.cpp>
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hrdstop
|
||||
#endif
|
||||
#include "boost/type_traits/type_traits_test.hpp"
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
int cpp_main(int argc, char* argv[])
|
||||
{
|
||||
value_test(true, (::boost::is_same<int, int>::value))
|
||||
value_test(false, (::boost::is_same<int, const int>::value))
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
#include <boost/type_traits/object_traits.hpp>
|
||||
#include <boost/utility.hpp>
|
||||
#include <boost/test/cpp_main.cpp>
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hrdstop
|
||||
@ -18,7 +19,7 @@ NESTED_DECL(is_scalar)
|
||||
NESTED_DECL(is_compound)
|
||||
NESTED_DECL(is_POD)
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
int cpp_main(int argc, char* argv[])
|
||||
{
|
||||
NESTED_TEST(is_class, int)
|
||||
NESTED_TEST(is_class, UDT)
|
||||
|
@ -7,6 +7,7 @@
|
||||
#include <boost/type_traits/transform_traits.hpp>
|
||||
#include <boost/type_traits/cv_traits.hpp>
|
||||
#include <boost/utility.hpp>
|
||||
#include <boost/test/cpp_main.cpp>
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hrdstop
|
||||
@ -434,7 +435,7 @@ void check_add_volatile()
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
int cpp_main(int argc, char* argv[])
|
||||
{
|
||||
check_remove_const();
|
||||
check_remove_volatile();
|
||||
|
Reference in New Issue
Block a user