From b48bd6a7a0f1770e355175f35b0d368edbe52387 Mon Sep 17 00:00:00 2001 From: Arkadiy Vertleyb Date: Wed, 31 Aug 2005 02:20:51 +0000 Subject: [PATCH] initial commit [SVN r30738] --- test/Jamfile | 12 ++++++++++++ test/test.hpp | 35 +++++++++++++++++++++++++++++++++++ test/type.cpp | 7 +++++++ 3 files changed, 54 insertions(+) create mode 100755 test/Jamfile create mode 100755 test/test.hpp create mode 100755 test/type.cpp diff --git a/test/Jamfile b/test/Jamfile new file mode 100755 index 0000000..434e526 --- /dev/null +++ b/test/Jamfile @@ -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 : BOOST_TYPEOF_NATIVE : type_native ] + [ compile type.cpp : BOOST_TYPEOF_COMPLIANT : type_emulation ] + ; diff --git a/test/test.hpp b/test/test.hpp new file mode 100755 index 0000000..031d655 --- /dev/null +++ b/test/test.hpp @@ -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 +#include +#include + +namespace boost { namespace type_of { + + template + struct test_wrapper{}; + + template + test_wrapper test_helper(test_wrapper*); + + template + struct test + { + enum {value = boost::is_same< + BOOST_TYPEOF_TPL(test_helper(reinterpret_cast*>(0))), + test_wrapper + >::value + }; + }; + +}} + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() +BOOST_TYPEOF_REGISTER_TEMPLATE(boost::type_of::test_wrapper, 1) + +#endif//BOOST_TYPEOF_TEST_HPP_INCLUDED diff --git a/test/type.cpp b/test/type.cpp new file mode 100755 index 0000000..50fcdb2 --- /dev/null +++ b/test/type.cpp @@ -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::value);