From 33fbd45af33c2e8cd6c243522f462abeffc8811b Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 6 Dec 2009 17:50:28 +0000 Subject: [PATCH 1/2] Merge [58123], [58127], [58128] to release. Fixes #3666. [SVN r58195] --- test/sp_typeinfo_test.cpp | 51 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 test/sp_typeinfo_test.cpp diff --git a/test/sp_typeinfo_test.cpp b/test/sp_typeinfo_test.cpp new file mode 100644 index 0000000..c47d04e --- /dev/null +++ b/test/sp_typeinfo_test.cpp @@ -0,0 +1,51 @@ +// +// sp_typeinfo_test.cpp +// +// Copyright (c) 2009 Peter Dimov +// +// Distributed under the Boost Software License, Version 1.0. +// See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt +// + +#include +#include +#include + +int main() +{ + BOOST_TEST( BOOST_SP_TYPEID( int ) == BOOST_SP_TYPEID( int ) ); + BOOST_TEST( BOOST_SP_TYPEID( int ) != BOOST_SP_TYPEID( long ) ); + BOOST_TEST( BOOST_SP_TYPEID( int ) != BOOST_SP_TYPEID( void ) ); + + boost::detail::sp_typeinfo const & ti = BOOST_SP_TYPEID( int ); + + boost::detail::sp_typeinfo const * pti = &BOOST_SP_TYPEID( int ); + BOOST_TEST( *pti == ti ); + + BOOST_TEST( ti == ti ); + BOOST_TEST( !( ti != ti ) ); + BOOST_TEST( !ti.before( ti ) ); + + char const * nti = ti.name(); + std::cout << nti << std::endl; + + boost::detail::sp_typeinfo const & tv = BOOST_SP_TYPEID( void ); + + boost::detail::sp_typeinfo const * ptv = &BOOST_SP_TYPEID( void ); + BOOST_TEST( *ptv == tv ); + + BOOST_TEST( tv == tv ); + BOOST_TEST( !( tv != tv ) ); + BOOST_TEST( !tv.before( tv ) ); + + char const * ntv = tv.name(); + std::cout << ntv << std::endl; + + BOOST_TEST( ti != tv ); + BOOST_TEST( !( ti == tv ) ); + + BOOST_TEST( ti.before( tv ) != tv.before( ti ) ); + + return boost::report_errors(); +} From d10e0ae09420480b2e13137796fb7595ad459867 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Mon, 14 Dec 2009 17:44:19 +0000 Subject: [PATCH 2/2] Merge [58275], [58306] to release. [SVN r58380] --- test/sp_typeinfo_test.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/sp_typeinfo_test.cpp b/test/sp_typeinfo_test.cpp index c47d04e..e29e576 100644 --- a/test/sp_typeinfo_test.cpp +++ b/test/sp_typeinfo_test.cpp @@ -28,7 +28,7 @@ int main() BOOST_TEST( !ti.before( ti ) ); char const * nti = ti.name(); - std::cout << nti << std::endl; + std::cout << nti << std::endl; boost::detail::sp_typeinfo const & tv = BOOST_SP_TYPEID( void ); @@ -40,7 +40,7 @@ int main() BOOST_TEST( !tv.before( tv ) ); char const * ntv = tv.name(); - std::cout << ntv << std::endl; + std::cout << ntv << std::endl; BOOST_TEST( ti != tv ); BOOST_TEST( !( ti == tv ) );