From a397391b0e9c79e6fd762364bdfbb722e9eed30e Mon Sep 17 00:00:00 2001 From: Antony Polukhin Date: Sun, 11 May 2014 16:13:12 +0400 Subject: [PATCH] Added ctti_print_name.cpp to ensure that BOOST_TYPE_INDEX_CTTI_USER_DEFINED_PARSING macro works --- test/Jamfile.v2 | 1 + test/ctti_print_name.cpp | 31 +++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 test/ctti_print_name.cpp diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 87722ac..f9961ba 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -40,6 +40,7 @@ test-suite type_index : [ run type_index_test.cpp $(tlib) ] [ run type_index_test.cpp $(tlib) : : : off : type_index_test_no_rtti ] + [ run ctti_print_name.cpp $(tlib) : : : off ] [ run testing_crossmodule.cpp test_lib_rtti $(tlib) ] [ run testing_crossmodule.cpp test_lib_nortti $(tlib) : : : off : testing_crossmodule_no_rtti ] [ run testing_crossmodule_anonymous.cpp test_lib_anonymous_rtti $(tlib) ] diff --git a/test/ctti_print_name.cpp b/test/ctti_print_name.cpp new file mode 100644 index 0000000..5d153ed --- /dev/null +++ b/test/ctti_print_name.cpp @@ -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 + + +// 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 + +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()); + BOOST_TEST_CHECKPOINT("double: " << ctti_type_index::type_id()); + BOOST_TEST_CHECKPOINT("user_defined_namespace::user_defined_class: " << ctti_type_index::type_id()); + + BOOST_CHECK(true); +} +