Added ctti_print_name.cpp to ensure that BOOST_TYPE_INDEX_CTTI_USER_DEFINED_PARSING macro works

This commit is contained in:
Antony Polukhin
2014-05-11 16:13:12 +04:00
parent 8c8d9c6c69
commit a397391b0e
2 changed files with 32 additions and 0 deletions

View File

@ -40,6 +40,7 @@ test-suite type_index
:
[ run type_index_test.cpp $(tlib) ]
[ run type_index_test.cpp $(tlib) : : : <rtti>off : type_index_test_no_rtti ]
[ run ctti_print_name.cpp $(tlib) : : : <rtti>off ]
[ run testing_crossmodule.cpp test_lib_rtti $(tlib) ]
[ run testing_crossmodule.cpp test_lib_nortti $(tlib) : : : <rtti>off : testing_crossmodule_no_rtti ]
[ run testing_crossmodule_anonymous.cpp test_lib_anonymous_rtti $(tlib) ]

31
test/ctti_print_name.cpp Normal file
View File

@ -0,0 +1,31 @@
//
// Copyright Antony Polukhin, 2012-2014.
//
// 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)
#define BOOST_TEST_MODULE type_index_ctti_test_module
#include <boost/test/unit_test.hpp>
// This cpp file:
// * tests BOOST_TYPE_INDEX_CTTI_USER_DEFINED_PARSING macro
// * outputs full ctti name so that TypeIndex library could be adjust to new compiler without requesting regression tester's help
#define BOOST_TYPE_INDEX_CTTI_USER_DEFINED_PARSING (0,0,false,"")
#include <boost/type_index.hpp>
namespace user_defined_namespace {
class user_defined_class {};
}
BOOST_AUTO_TEST_CASE(ctti_print_full_string_helper_test)
{
using namespace boost::typeindex;
BOOST_TEST_CHECKPOINT("int: " << ctti_type_index::type_id<int>());
BOOST_TEST_CHECKPOINT("double: " << ctti_type_index::type_id<double>());
BOOST_TEST_CHECKPOINT("user_defined_namespace::user_defined_class: " << ctti_type_index::type_id<user_defined_namespace::user_defined_class>());
BOOST_CHECK(true);
}