forked from boostorg/typeof
Compare commits
1 Commits
esp-idf-co
...
svn-branch
Author | SHA1 | Date | |
---|---|---|---|
e3d6cfe137 |
42
test/Jamfile
42
test/Jamfile
@ -1,42 +0,0 @@
|
||||
# Boost Typeof Library test Jamfile
|
||||
|
||||
subproject libs/typeof/test ;
|
||||
|
||||
# bring in rules for testing
|
||||
import testing ;
|
||||
|
||||
test-suite "typeof"
|
||||
:
|
||||
[ compile type.cpp : <define>BOOST_TYPEOF_NATIVE : type_native ]
|
||||
[ compile type.cpp : <define>BOOST_TYPEOF_COMPLIANT : type_emulation ]
|
||||
|
||||
[ compile template_type.cpp : <define>BOOST_TYPEOF_NATIVE : template_type_native ]
|
||||
[ compile template_type.cpp : <define>BOOST_TYPEOF_COMPLIANT : template_type_emulation ]
|
||||
|
||||
[ compile template_int.cpp : <define>BOOST_TYPEOF_NATIVE : template_int_native ]
|
||||
[ compile template_int.cpp : <define>BOOST_TYPEOF_COMPLIANT : template_int_emulation ]
|
||||
|
||||
[ compile template_tpl.cpp : <define>BOOST_TYPEOF_NATIVE : template_tpl_native ]
|
||||
[ compile template_tpl.cpp : <define>BOOST_TYPEOF_COMPLIANT : template_tpl_emulation ]
|
||||
|
||||
[ compile modifiers.cpp : <define>BOOST_TYPEOF_NATIVE : modifiers_native ]
|
||||
[ compile modifiers.cpp : <define>BOOST_TYPEOF_COMPLIANT : modifiers_emulation ]
|
||||
|
||||
[ compile function.cpp : <define>BOOST_TYPEOF_NATIVE : function_native ]
|
||||
[ compile function.cpp : <define>BOOST_TYPEOF_COMPLIANT : function_emulation ]
|
||||
|
||||
[ compile function_ptr.cpp : <define>BOOST_TYPEOF_NATIVE : function_ptr_native ]
|
||||
[ compile function_ptr.cpp : <define>BOOST_TYPEOF_COMPLIANT : function_ptr_emulation ]
|
||||
|
||||
[ compile function_ref.cpp : <define>BOOST_TYPEOF_NATIVE : function_ref_native ]
|
||||
[ compile function_ref.cpp : <define>BOOST_TYPEOF_COMPLIANT : function_ref_emulation ]
|
||||
|
||||
[ compile member_function.cpp : <define>BOOST_TYPEOF_NATIVE : member_function_native ]
|
||||
[ compile member_function.cpp : <define>BOOST_TYPEOF_COMPLIANT : member_function_emulation ]
|
||||
|
||||
[ compile data_member.cpp : <define>BOOST_TYPEOF_NATIVE : data_member_native ]
|
||||
[ compile data_member.cpp : <define>BOOST_TYPEOF_COMPLIANT : data_member_emulation ]
|
||||
|
||||
[ compile lvalue.cpp : <define>BOOST_TYPEOF_NATIVE : lvalue_native ]
|
||||
[ compile lvalue.cpp : <define>BOOST_TYPEOF_COMPLIANT : lvalue_emulation ]
|
||||
;
|
@ -1,7 +0,0 @@
|
||||
#include "test.hpp"
|
||||
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
|
||||
|
||||
struct x;
|
||||
BOOST_TYPEOF_REGISTER_TYPE(x)
|
||||
|
||||
BOOST_STATIC_ASSERT(boost::type_of::test<double x::*>::value);
|
@ -1,4 +0,0 @@
|
||||
#include "test.hpp"
|
||||
|
||||
BOOST_STATIC_ASSERT(boost::type_of::test<void()>::value);
|
||||
BOOST_STATIC_ASSERT(boost::type_of::test<double(bool)>::value);
|
@ -1,6 +0,0 @@
|
||||
#include "test.hpp"
|
||||
|
||||
BOOST_STATIC_ASSERT(boost::type_of::test<double(*)()>::value);
|
||||
BOOST_STATIC_ASSERT(boost::type_of::test<double(*)(int, double, short, char*, bool, char, float, long, unsigned short)>::value);
|
||||
BOOST_STATIC_ASSERT(boost::type_of::test<void(*)()>::value);
|
||||
BOOST_STATIC_ASSERT(boost::type_of::test<void(*)(int, double, short, char*, bool, char, float, long, unsigned short)>::value);
|
@ -1,4 +0,0 @@
|
||||
#include "test.hpp"
|
||||
|
||||
BOOST_STATIC_ASSERT(boost::type_of::test<void(&)()>::value);
|
||||
BOOST_STATIC_ASSERT(boost::type_of::test<int(&)(int, short)>::value);
|
@ -1,26 +0,0 @@
|
||||
#include <boost/typeof/typeof.hpp>
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
|
||||
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
|
||||
|
||||
struct x{};
|
||||
BOOST_TYPEOF_REGISTER_TYPE(x)
|
||||
|
||||
x n;
|
||||
const x cn = n;
|
||||
x& rn = n;
|
||||
const x& rcn = cn;
|
||||
x f();
|
||||
const x cf();
|
||||
x& rf();
|
||||
const x& rcf();
|
||||
|
||||
BOOST_STATIC_ASSERT((boost::is_same<BOOST_LVALUE_TYPEOF(n), x&>::value));
|
||||
BOOST_STATIC_ASSERT((boost::is_same<BOOST_LVALUE_TYPEOF(cn), const x&>::value));
|
||||
BOOST_STATIC_ASSERT((boost::is_same<BOOST_LVALUE_TYPEOF(rn), x&>::value));
|
||||
BOOST_STATIC_ASSERT((boost::is_same<BOOST_LVALUE_TYPEOF(rcn), const x&>::value));
|
||||
BOOST_STATIC_ASSERT((boost::is_same<BOOST_LVALUE_TYPEOF(f()), x>::value));
|
||||
BOOST_STATIC_ASSERT((boost::is_same<BOOST_LVALUE_TYPEOF(rf()), x&>::value));
|
||||
BOOST_STATIC_ASSERT((boost::is_same<BOOST_LVALUE_TYPEOF(rcf()), const x&>::value));
|
||||
BOOST_STATIC_ASSERT((boost::is_same<BOOST_LVALUE_TYPEOF(cf()), const x&>::value));
|
@ -1,6 +0,0 @@
|
||||
#include "test.hpp"
|
||||
|
||||
BOOST_STATIC_ASSERT(boost::type_of::test<double(*)()>::value);
|
||||
BOOST_STATIC_ASSERT(boost::type_of::test<double(*)(int, double, short, char*, bool, char, float, long, unsigned short)>::value);
|
||||
BOOST_STATIC_ASSERT(boost::type_of::test<void(*)()>::value);
|
||||
BOOST_STATIC_ASSERT(boost::type_of::test<void(*)(int, double, short, char*, bool, char, float, long, unsigned short)>::value);
|
@ -1,12 +0,0 @@
|
||||
#include "test.hpp"
|
||||
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
|
||||
|
||||
struct x;
|
||||
BOOST_TYPEOF_REGISTER_TYPE(x)
|
||||
|
||||
BOOST_STATIC_ASSERT(boost::type_of::test<x*>::value);
|
||||
BOOST_STATIC_ASSERT(boost::type_of::test<x&>::value);
|
||||
BOOST_STATIC_ASSERT(boost::type_of::test<x[20]>::value);
|
||||
BOOST_STATIC_ASSERT(boost::type_of::test<const x>::value);
|
||||
BOOST_STATIC_ASSERT(boost::type_of::test<volatile x>::value);
|
||||
BOOST_STATIC_ASSERT(boost::type_of::test<volatile const x>::value);
|
@ -1,26 +0,0 @@
|
||||
#include "test.hpp"
|
||||
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
|
||||
|
||||
struct x;
|
||||
BOOST_TYPEOF_REGISTER_TYPE(x)
|
||||
|
||||
template<
|
||||
class T, char c, unsigned short us, int i, unsigned long ul,
|
||||
bool b1, bool b2, signed char sc, unsigned u>
|
||||
struct Tpl
|
||||
{};
|
||||
|
||||
BOOST_TYPEOF_REGISTER_TEMPLATE(Tpl,
|
||||
(class)
|
||||
(char)
|
||||
(unsigned short)
|
||||
(int)
|
||||
(unsigned long)
|
||||
(bool)
|
||||
(bool)
|
||||
(signed char)
|
||||
(unsigned)
|
||||
)
|
||||
|
||||
BOOST_STATIC_ASSERT((boost::type_of::test<Tpl<int, 5, 4, -3, 2, true, false, -1, 5> >::value));
|
||||
BOOST_STATIC_ASSERT((boost::type_of::test<Tpl<int, 1, 1, 0, ULONG_MAX, false, true, -1, 0> >::value));
|
@ -1,22 +0,0 @@
|
||||
#include "test.hpp"
|
||||
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
|
||||
|
||||
template<class T, class U>
|
||||
struct t0;
|
||||
|
||||
template<class T, int n>
|
||||
struct t1;
|
||||
|
||||
template<template<class, class> class T, template<class, int> class U>
|
||||
struct t2;
|
||||
|
||||
BOOST_TYPEOF_REGISTER_TEMPLATE(t0, 2)
|
||||
|
||||
BOOST_TYPEOF_REGISTER_TEMPLATE(t1, (class)(int))
|
||||
|
||||
BOOST_TYPEOF_REGISTER_TEMPLATE(t2,
|
||||
(BOOST_TYPEOF_TEMPLATE(2))
|
||||
(BOOST_TYPEOF_TEMPLATE((class)(int)))
|
||||
)
|
||||
|
||||
BOOST_STATIC_ASSERT((boost::type_of::test<t2<t0, t1> >::value));
|
@ -1,13 +0,0 @@
|
||||
#include "test.hpp"
|
||||
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
|
||||
|
||||
struct P1;
|
||||
struct P2;
|
||||
|
||||
template<class P1, class P2> struct Tpl;
|
||||
|
||||
BOOST_TYPEOF_REGISTER_TYPE(P1)
|
||||
BOOST_TYPEOF_REGISTER_TYPE(P2)
|
||||
BOOST_TYPEOF_REGISTER_TEMPLATE(Tpl, 2)
|
||||
|
||||
BOOST_STATIC_ASSERT((boost::type_of::test<Tpl<P1, P2> >::value));
|
@ -1,35 +0,0 @@
|
||||
// Copyright (C) 2005 Arkadiy Vertleyb
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_TYPEOF_TEST_HPP_INCLUDED
|
||||
#define BOOST_TYPEOF_TEST_HPP_INCLUDED
|
||||
|
||||
#include <boost/typeof/typeof.hpp>
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
|
||||
namespace boost { namespace type_of {
|
||||
|
||||
template<class T, class U>
|
||||
struct test_wrapper{};
|
||||
|
||||
template<class T>
|
||||
test_wrapper<T, T> test_helper(test_wrapper<T, T>*);
|
||||
|
||||
template<class T>
|
||||
struct test
|
||||
{
|
||||
enum {value = boost::is_same<
|
||||
BOOST_TYPEOF_TPL(test_helper(reinterpret_cast<test_wrapper<T, T>*>(0))),
|
||||
test_wrapper<T, T>
|
||||
>::value
|
||||
};
|
||||
};
|
||||
|
||||
}}
|
||||
|
||||
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
|
||||
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::type_of::test_wrapper, 2)
|
||||
|
||||
#endif//BOOST_TYPEOF_TEST_HPP_INCLUDED
|
@ -1,7 +0,0 @@
|
||||
#include "test.hpp"
|
||||
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
|
||||
|
||||
struct A;
|
||||
BOOST_TYPEOF_REGISTER_TYPE(A)
|
||||
|
||||
BOOST_STATIC_ASSERT(boost::type_of::test<A>::value);
|
Reference in New Issue
Block a user