initial commit

[SVN r30738]
This commit is contained in:
Arkadiy Vertleyb
2005-08-31 02:20:51 +00:00
parent 08c09b86b3
commit b48bd6a7a0
3 changed files with 54 additions and 0 deletions

12
test/Jamfile Executable file
View File

@ -0,0 +1,12 @@
# 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 ]
;

35
test/test.hpp Executable file
View File

@ -0,0 +1,35 @@
// 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>
struct test_wrapper{};
template<class T>
test_wrapper<T> test_helper(test_wrapper<T>*);
template<class T>
struct test
{
enum {value = boost::is_same<
BOOST_TYPEOF_TPL(test_helper(reinterpret_cast<test_wrapper<T>*>(0))),
test_wrapper<T>
>::value
};
};
}}
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::type_of::test_wrapper, 1)
#endif//BOOST_TYPEOF_TEST_HPP_INCLUDED

7
test/type.cpp Executable file
View File

@ -0,0 +1,7 @@
#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);