diff options
Diffstat (limited to 'boost/test/utils/runtime/cla')
33 files changed, 448 insertions, 425 deletions
diff --git a/boost/test/utils/runtime/cla/argument_factory.hpp b/boost/test/utils/runtime/cla/argument_factory.hpp index 19ccc08c0f..6683540612 100644 --- a/boost/test/utils/runtime/cla/argument_factory.hpp +++ b/boost/test/utils/runtime/cla/argument_factory.hpp @@ -1,6 +1,6 @@ -// (C) Copyright Gennadiy Rozental 2005-2008. -// Use, modification, and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file +// (C) Copyright Gennadiy Rozental 2005-2014. +// Use, modification, and distribution are subject to 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) // See http://www.boost.org/libs/test for the library home page. @@ -12,8 +12,8 @@ // Description : generic typed_argument_factory implementation // *************************************************************************** -#ifndef BOOST_RT_CLA_ARGUMENT_FACTORY_HPP_062604GER -#define BOOST_RT_CLA_ARGUMENT_FACTORY_HPP_062604GER +#ifndef BOOST_TEST_UTILS_RUNTIME_CLA_ARGUMENT_FACTORY_HPP +#define BOOST_TEST_UTILS_RUNTIME_CLA_ARGUMENT_FACTORY_HPP // Boost.Runtime.Parameter #include <boost/test/utils/runtime/config.hpp> @@ -33,15 +33,13 @@ #include <boost/test/utils/runtime/cla/iface/argument_factory.hpp> -// Boost.Test -#include <boost/test/utils/callback.hpp> - // Boost #include <boost/optional.hpp> +#include <boost/function/function2.hpp> namespace boost { -namespace BOOST_RT_PARAM_NAMESPACE { +namespace BOOST_TEST_UTILS_RUNTIME_PARAM_NAMESPACE { namespace cla { @@ -72,7 +70,7 @@ struct typed_argument_factory : public argument_factory { typed_argument_factory() : m_value_interpreter( rt_cla_detail::default_value_interpreter() ) {} - BOOST_RT_PARAM_UNNEEDED_VIRTUAL ~typed_argument_factory() {} + BOOST_TEST_UTILS_RUNTIME_PARAM_UNNEEDED_VIRTUAL ~typed_argument_factory() {} // properties modification template<typename Modifier> @@ -82,24 +80,24 @@ struct typed_argument_factory : public argument_factory { optionally_assign( m_value_interpreter, m, interpreter ); if( m.has( default_value ) ) { - BOOST_RT_PARAM_VALIDATE_LOGIC( !m_value_generator, - BOOST_RT_PARAM_LITERAL( "multiple value generators for parameter" ) ); + BOOST_TEST_UTILS_RUNTIME_PARAM_VALIDATE_LOGIC( !m_value_generator, + BOOST_TEST_UTILS_RUNTIME_PARAM_LITERAL( "multiple value generators for parameter" ) ); T const& dv_ref = m[default_value]; m_value_generator = rt_cla_detail::const_generator<T>( dv_ref ); } if( m.has( default_refer_to ) ) { - BOOST_RT_PARAM_VALIDATE_LOGIC( !m_value_generator, - BOOST_RT_PARAM_LITERAL( "multiple value generators for parameter" ) ); + BOOST_TEST_UTILS_RUNTIME_PARAM_VALIDATE_LOGIC( !m_value_generator, + BOOST_TEST_UTILS_RUNTIME_PARAM_LITERAL( "multiple value generators for parameter" ) ); cstring ref_id = m[default_refer_to]; m_value_generator = rt_cla_detail::ref_generator<T>( ref_id ); } if( m.has( assign_to ) ) { - BOOST_RT_PARAM_VALIDATE_LOGIC( !m_value_handler, - BOOST_RT_PARAM_LITERAL( "multiple value handlers for parameter" ) ); + BOOST_TEST_UTILS_RUNTIME_PARAM_VALIDATE_LOGIC( !m_value_handler, + BOOST_TEST_UTILS_RUNTIME_PARAM_LITERAL( "multiple value handlers for parameter" ) ); m_value_handler = rt_cla_detail::assigner<T>( m[assign_to] ); } @@ -112,9 +110,9 @@ struct typed_argument_factory : public argument_factory { // !! private? // Data members - unit_test::callback2<parameter const&,T&> m_value_handler; - unit_test::callback2<parser const&,boost::optional<T>&> m_value_generator; - unit_test::callback2<argv_traverser&,boost::optional<T>&> m_value_interpreter; + boost::function<void (parameter const&,T&)> m_value_handler; + boost::function<void (parser const&,boost::optional<T>&)> m_value_generator; + boost::function<void (argv_traverser&,boost::optional<T>&)> m_value_interpreter; }; //____________________________________________________________________________// @@ -125,23 +123,23 @@ typed_argument_factory<T>::produce_using( parameter& p, argv_traverser& tr ) { boost::optional<T> value; - try { + BOOST_TEST_IMPL_TRY { m_value_interpreter( tr, value ); } - catch( ... ) { // !! should we do that? - BOOST_RT_PARAM_TRACE( "Fail to parse argument value" ); + BOOST_TEST_IMPL_CATCHALL() { // !! should we do that? + BOOST_TEST_UTILS_RUNTIME_PARAM_TRACE( "Fail to parse argument value" ); if( !p.p_optional_value ) - throw; + BOOST_TEST_IMPL_RETHROW; } argument_ptr actual_arg = p.actual_argument(); - BOOST_RT_CLA_VALIDATE_INPUT( !!value || p.p_optional_value, tr, - BOOST_RT_PARAM_LITERAL( "Argument value missing for parameter " ) << p.id_2_report() ); + BOOST_TEST_UTILS_RUNTIME_CLA_VALIDATE_INPUT( !!value || p.p_optional_value, tr, + BOOST_TEST_UTILS_RUNTIME_PARAM_LITERAL( "Argument value missing for parameter " ) << p.id_2_report() ); - BOOST_RT_CLA_VALIDATE_INPUT( !actual_arg || p.p_multiplicable, tr, - BOOST_RT_PARAM_LITERAL( "Unexpected repetition of the parameter " ) << p.id_2_report() ); + BOOST_TEST_UTILS_RUNTIME_CLA_VALIDATE_INPUT( !actual_arg || p.p_multiplicable, tr, + BOOST_TEST_UTILS_RUNTIME_PARAM_LITERAL( "Unexpected repetition of the parameter " ) << p.id_2_report() ); if( !!value && !!m_value_handler ) m_value_handler( p, *value ); @@ -154,7 +152,7 @@ typed_argument_factory<T>::produce_using( parameter& p, argv_traverser& tr ) typedef std::list<boost::optional<T> > optional_list; if( !actual_arg ) - actual_arg.reset( p.p_optional_value + actual_arg.reset( p.p_optional_value ? static_cast<argument*>(new typed_argument<optional_list>( p )) : static_cast<argument*>(new typed_argument<std::list<T> >( p )) ); @@ -165,7 +163,7 @@ typed_argument_factory<T>::produce_using( parameter& p, argv_traverser& tr ) } else { std::list<T>& values = arg_value<std::list<T> >( *actual_arg ); - + values.push_back( *value ); } } @@ -176,7 +174,7 @@ typed_argument_factory<T>::produce_using( parameter& p, argv_traverser& tr ) //____________________________________________________________________________// template<typename T> -inline argument_ptr +inline argument_ptr typed_argument_factory<T>::produce_using( parameter& p, parser const& pa ) { argument_ptr actual_arg; @@ -211,8 +209,8 @@ typed_argument_factory<T>::argument_usage_info( format_stream& fs ) } // namespace boost -} // namespace BOOST_RT_PARAM_NAMESPACE +} // namespace BOOST_TEST_UTILS_RUNTIME_PARAM_NAMESPACE } // namespace cla -#endif // BOOST_RT_CLA_ARGUMENT_FACTORY_HPP_062604GER +#endif // BOOST_TEST_UTILS_RUNTIME_CLA_ARGUMENT_FACTORY_HPP diff --git a/boost/test/utils/runtime/cla/argv_traverser.cpp b/boost/test/utils/runtime/cla/argv_traverser.cpp index a7a44f7fd9..9716b8fb9c 100644 --- a/boost/test/utils/runtime/cla/argv_traverser.cpp +++ b/boost/test/utils/runtime/cla/argv_traverser.cpp @@ -1,6 +1,6 @@ -// (C) Copyright Gennadiy Rozental 2005-2008. -// Use, modification, and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file +// (C) Copyright Gennadiy Rozental 2005-2014. +// Use, modification, and distribution are subject to 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) // See http://www.boost.org/libs/test for the library home page. @@ -12,5 +12,5 @@ // Description : offline implementation for argc/argv traverser // *************************************************************************** -#define BOOST_RT_PARAM_INLINE +#define BOOST_TEST_UTILS_RUNTIME_PARAM_INLINE #include <boost/test/utils/runtime/cla/argv_traverser.ipp> diff --git a/boost/test/utils/runtime/cla/argv_traverser.hpp b/boost/test/utils/runtime/cla/argv_traverser.hpp index 58cf2fe5f7..6f6e03dfc8 100644 --- a/boost/test/utils/runtime/cla/argv_traverser.hpp +++ b/boost/test/utils/runtime/cla/argv_traverser.hpp @@ -1,6 +1,6 @@ -// (C) Copyright Gennadiy Rozental 2005-2008. -// Use, modification, and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file +// (C) Copyright Gennadiy Rozental 2005-2014. +// Use, modification, and distribution are subject to 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) // See http://www.boost.org/libs/test for the library home page. @@ -12,8 +12,8 @@ // Description : defines facility to hide input traversing details // *************************************************************************** -#ifndef BOOST_RT_CLA_ARGV_TRAVERSER_HPP_062604GER -#define BOOST_RT_CLA_ARGV_TRAVERSER_HPP_062604GER +#ifndef BOOST_TEST_UTILS_RUNTIME_CLA_ARGV_TRAVERSER_HPP +#define BOOST_TEST_UTILS_RUNTIME_CLA_ARGV_TRAVERSER_HPP // Boost.Runtime.Parameter #include <boost/test/utils/runtime/config.hpp> @@ -27,7 +27,7 @@ namespace boost { -namespace BOOST_RT_PARAM_NAMESPACE { +namespace BOOST_TEST_UTILS_RUNTIME_PARAM_NAMESPACE { namespace cla { @@ -84,15 +84,17 @@ private: } // namespace cla -} // namespace BOOST_RT_PARAM_NAMESPACE +} // namespace BOOST_TEST_UTILS_RUNTIME_PARAM_NAMESPACE } // namespace boost -#ifndef BOOST_RT_PARAM_OFFLINE +#ifndef BOOST_TEST_UTILS_RUNTIME_PARAM_OFFLINE -# define BOOST_RT_PARAM_INLINE inline -# include <boost/test/utils/runtime/cla/argv_traverser.ipp> +#ifndef BOOST_TEST_UTILS_RUNTIME_PARAM_INLINE +# define BOOST_TEST_UTILS_RUNTIME_PARAM_INLINE inline +#endif +# include <boost/test/utils/runtime/cla/argv_traverser.ipp> #endif -#endif // BOOST_RT_CLA_ARGV_TRAVERSER_HPP_062604GER +#endif // BOOST_TEST_UTILS_RUNTIME_CLA_ARGV_TRAVERSER_HPP diff --git a/boost/test/utils/runtime/cla/argv_traverser.ipp b/boost/test/utils/runtime/cla/argv_traverser.ipp index 2b5e3818b3..d1ae93be82 100644 --- a/boost/test/utils/runtime/cla/argv_traverser.ipp +++ b/boost/test/utils/runtime/cla/argv_traverser.ipp @@ -1,6 +1,6 @@ -// (C) Copyright Gennadiy Rozental 2005-2008. -// Use, modification, and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file +// (C) Copyright Gennadiy Rozental 2005-2014. +// Use, modification, and distribution are subject to 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) // See http://www.boost.org/libs/test for the library home page. @@ -12,8 +12,8 @@ // Description : implements facility to hide input traversing details // *************************************************************************** -#ifndef BOOST_RT_CLA_ARGV_TRAVERSER_IPP_070604GER -#define BOOST_RT_CLA_ARGV_TRAVERSER_IPP_070604GER +#ifndef BOOST_TEST_UTILS_RUNTIME_CLA_ARGV_TRAVERSER_IPP +#define BOOST_TEST_UTILS_RUNTIME_CLA_ARGV_TRAVERSER_IPP // Boost.Runtime.Parameter #include <boost/test/utils/runtime/trace.hpp> @@ -30,7 +30,7 @@ namespace std { using ::memcpy; } namespace boost { -namespace BOOST_RT_PARAM_NAMESPACE { +namespace BOOST_TEST_UTILS_RUNTIME_PARAM_NAMESPACE { namespace cla { @@ -38,21 +38,23 @@ namespace cla { // ************** runtime::cla::argv_traverser ************** // // ************************************************************************** // -BOOST_RT_PARAM_INLINE +BOOST_TEST_UTILS_RUNTIME_PARAM_INLINE argv_traverser::argv_traverser() -: p_ignore_mismatch( false ), p_separator( BOOST_RT_PARAM_LITERAL( ' ' ) ) +: p_ignore_mismatch( false ), p_separator( BOOST_TEST_UTILS_RUNTIME_PARAM_LITERAL( ' ' ) ) { } //____________________________________________________________________________// -BOOST_RT_PARAM_INLINE void +BOOST_TEST_UTILS_RUNTIME_PARAM_INLINE void argv_traverser::init( int argc, char_type** argv ) { + m_buffer.clear(); + for( int index = 1; index < argc; ++index ) { m_buffer += argv[index]; if( index != argc-1 ) - m_buffer += BOOST_RT_PARAM_LITERAL( ' ' ); + m_buffer += BOOST_TEST_UTILS_RUNTIME_PARAM_LITERAL( ' ' ); } m_remainder.reset( new char_type[m_buffer.size()+1] ); @@ -60,14 +62,14 @@ argv_traverser::init( int argc, char_type** argv ) m_work_buffer = m_buffer; m_commited_end = m_work_buffer.begin(); - BOOST_RT_PARAM_TRACE( "Input buffer: " << m_buffer ); + BOOST_TEST_UTILS_RUNTIME_PARAM_TRACE( "Input buffer: " << m_buffer ); next_token(); } //____________________________________________________________________________// -BOOST_RT_PARAM_INLINE void +BOOST_TEST_UTILS_RUNTIME_PARAM_INLINE void argv_traverser::remainder( int& argc, char_type** argv ) { argc = 1; @@ -75,15 +77,16 @@ argv_traverser::remainder( int& argc, char_type** argv ) while(pos < m_remainder_size ) { argv[argc++] = m_remainder.get() + pos; - pos = std::find( m_remainder.get() + pos, m_remainder.get() + m_remainder_size, - BOOST_RT_PARAM_LITERAL( ' ' ) ) - m_remainder.get(); - m_remainder[pos++] = BOOST_RT_PARAM_LITERAL( '\0' ); + pos = static_cast<size_t>(std::find( m_remainder.get() + pos, m_remainder.get() + m_remainder_size, + BOOST_TEST_UTILS_RUNTIME_PARAM_LITERAL( ' ' ) ) - + m_remainder.get()); + m_remainder[pos++] = BOOST_TEST_UTILS_RUNTIME_PARAM_LITERAL( '\0' ); } } //____________________________________________________________________________// -BOOST_RT_PARAM_INLINE cstring +BOOST_TEST_UTILS_RUNTIME_PARAM_INLINE cstring argv_traverser::token() const { return m_token; @@ -91,7 +94,7 @@ argv_traverser::token() const //____________________________________________________________________________// -BOOST_RT_PARAM_INLINE void +BOOST_TEST_UTILS_RUNTIME_PARAM_INLINE void argv_traverser::next_token() { if( m_work_buffer.is_empty() ) @@ -108,7 +111,7 @@ argv_traverser::next_token() //____________________________________________________________________________// -BOOST_RT_PARAM_INLINE cstring +BOOST_TEST_UTILS_RUNTIME_PARAM_INLINE cstring argv_traverser::input() const { return m_work_buffer; @@ -116,7 +119,7 @@ argv_traverser::input() const //____________________________________________________________________________// -BOOST_RT_PARAM_INLINE void +BOOST_TEST_UTILS_RUNTIME_PARAM_INLINE void argv_traverser::trim( std::size_t size ) { m_work_buffer.trim_left( size ); @@ -131,7 +134,7 @@ argv_traverser::trim( std::size_t size ) //____________________________________________________________________________// -BOOST_RT_PARAM_INLINE bool +BOOST_TEST_UTILS_RUNTIME_PARAM_INLINE bool argv_traverser::match_front( cstring str ) { return m_work_buffer.size() < str.size() ? false : m_work_buffer.substr( 0, str.size() ) == str; @@ -139,7 +142,7 @@ argv_traverser::match_front( cstring str ) //____________________________________________________________________________// -BOOST_RT_PARAM_INLINE bool +BOOST_TEST_UTILS_RUNTIME_PARAM_INLINE bool argv_traverser::match_front( char_type c ) { return first_char( m_work_buffer ) == c; @@ -147,7 +150,7 @@ argv_traverser::match_front( char_type c ) //____________________________________________________________________________// -BOOST_RT_PARAM_INLINE bool +BOOST_TEST_UTILS_RUNTIME_PARAM_INLINE bool argv_traverser::eoi() const { return m_work_buffer.is_empty(); @@ -155,7 +158,7 @@ argv_traverser::eoi() const //____________________________________________________________________________// -BOOST_RT_PARAM_INLINE void +BOOST_TEST_UTILS_RUNTIME_PARAM_INLINE void argv_traverser::commit() { m_commited_end = m_work_buffer.begin(); @@ -163,7 +166,7 @@ argv_traverser::commit() //____________________________________________________________________________// -BOOST_RT_PARAM_INLINE void +BOOST_TEST_UTILS_RUNTIME_PARAM_INLINE void argv_traverser::rollback() { m_work_buffer.assign( m_commited_end, m_work_buffer.end() ); @@ -174,15 +177,15 @@ argv_traverser::rollback() //____________________________________________________________________________// -BOOST_RT_PARAM_INLINE std::size_t +BOOST_TEST_UTILS_RUNTIME_PARAM_INLINE std::size_t argv_traverser::input_pos() const { - return m_work_buffer.begin() - m_commited_end; + return static_cast<std::size_t>(m_work_buffer.begin() - m_commited_end); } //____________________________________________________________________________// -BOOST_RT_PARAM_INLINE bool +BOOST_TEST_UTILS_RUNTIME_PARAM_INLINE bool argv_traverser::handle_mismatch() { if( !p_ignore_mismatch ) @@ -202,8 +205,8 @@ argv_traverser::handle_mismatch() } // namespace cla -} // namespace BOOST_RT_PARAM_NAMESPACE +} // namespace BOOST_TEST_UTILS_RUNTIME_PARAM_NAMESPACE } // namespace boost -#endif // BOOST_RT_CLA_ARGV_TRAVERSER_IPP_070604GER +#endif // BOOST_TEST_UTILS_RUNTIME_CLA_ARGV_TRAVERSER_IPP diff --git a/boost/test/utils/runtime/cla/basic_parameter.hpp b/boost/test/utils/runtime/cla/basic_parameter.hpp index 8b826bba0a..817b12a301 100644 --- a/boost/test/utils/runtime/cla/basic_parameter.hpp +++ b/boost/test/utils/runtime/cla/basic_parameter.hpp @@ -1,6 +1,6 @@ -// (C) Copyright Gennadiy Rozental 2005-2008. -// Use, modification, and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file +// (C) Copyright Gennadiy Rozental 2005-2014. +// Use, modification, and distribution are subject to 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) // See http://www.boost.org/libs/test for the library home page. @@ -12,8 +12,8 @@ // Description : generic custom parameter generator // *************************************************************************** -#ifndef BOOST_RT_CLA_BASIC_PARAMETER_HPP_062604GER -#define BOOST_RT_CLA_BASIC_PARAMETER_HPP_062604GER +#ifndef BOOST_TEST_UTILS_RUNTIME_CLA_BASIC_PARAMETER_HPP +#define BOOST_TEST_UTILS_RUNTIME_CLA_BASIC_PARAMETER_HPP // Boost.Runtime.Parameter #include <boost/test/utils/runtime/config.hpp> @@ -28,7 +28,7 @@ namespace boost { -namespace BOOST_RT_PARAM_NAMESPACE { +namespace BOOST_TEST_UTILS_RUNTIME_PARAM_NAMESPACE { namespace cla { @@ -40,7 +40,7 @@ template<typename T, typename IdPolicy> class basic_parameter : private base_from_member<IdPolicy>, public typed_parameter<T> { public: // Constructors - explicit basic_parameter( cstring n ) + explicit basic_parameter( cstring n ) : base_from_member<IdPolicy>() , typed_parameter<T>( base_from_member<IdPolicy>::member ) { @@ -59,7 +59,7 @@ public: //____________________________________________________________________________// -#define BOOST_RT_CLA_NAMED_PARAM_GENERATORS( param_type ) \ +#define BOOST_TEST_UTILS_RUNTIME_CLA_NAMED_PARAM_GENERATORS( param_type ) \ template<typename T> \ inline shared_ptr<param_type ## _t<T> > \ param_type( cstring name = cstring() ) \ @@ -78,8 +78,8 @@ param_type( cstring name = cstring() ) } // namespace cla -} // namespace BOOST_RT_PARAM_NAMESPACE +} // namespace BOOST_TEST_UTILS_RUNTIME_PARAM_NAMESPACE } // namespace boost -#endif // BOOST_RT_CLA_BASIC_PARAMETER_HPP_062604GER +#endif // BOOST_TEST_UTILS_RUNTIME_CLA_BASIC_PARAMETER_HPP diff --git a/boost/test/utils/runtime/cla/char_parameter.cpp b/boost/test/utils/runtime/cla/char_parameter.cpp index 017402e8e7..6e85fe4136 100644 --- a/boost/test/utils/runtime/cla/char_parameter.cpp +++ b/boost/test/utils/runtime/cla/char_parameter.cpp @@ -1,6 +1,6 @@ -// (C) Copyright Gennadiy Rozental 2005-2008. -// Use, modification, and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file +// (C) Copyright Gennadiy Rozental 2005-2014. +// Use, modification, and distribution are subject to 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) // See http://www.boost.org/libs/test for the library home page. @@ -12,5 +12,5 @@ // Description : offline implementation of char parameter // *************************************************************************** -#define BOOST_RT_PARAM_INLINE +#define BOOST_TEST_UTILS_RUNTIME_PARAM_INLINE #include <boost/test/utils/runtime/cla/char_parameter.ipp> diff --git a/boost/test/utils/runtime/cla/char_parameter.hpp b/boost/test/utils/runtime/cla/char_parameter.hpp index 425c24f3f9..0e2928b1af 100644 --- a/boost/test/utils/runtime/cla/char_parameter.hpp +++ b/boost/test/utils/runtime/cla/char_parameter.hpp @@ -1,6 +1,6 @@ -// (C) Copyright Gennadiy Rozental 2005-2008. -// Use, modification, and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file +// (C) Copyright Gennadiy Rozental 2005-2014. +// Use, modification, and distribution are subject to 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) // See http://www.boost.org/libs/test for the library home page. @@ -12,8 +12,8 @@ // Description : defines model of parameter with single char name // *************************************************************************** -#ifndef BOOST_RT_CLA_CHAR_PARAMETER_HPP_062604GER -#define BOOST_RT_CLA_CHAR_PARAMETER_HPP_062604GER +#ifndef BOOST_TEST_UTILS_RUNTIME_CLA_CHAR_PARAMETER_HPP +#define BOOST_TEST_UTILS_RUNTIME_CLA_CHAR_PARAMETER_HPP // Boost.Runtime.Parameter #include <boost/test/utils/runtime/config.hpp> @@ -24,7 +24,7 @@ namespace boost { -namespace BOOST_RT_PARAM_NAMESPACE { +namespace BOOST_TEST_UTILS_RUNTIME_PARAM_NAMESPACE { namespace cla { @@ -36,7 +36,7 @@ class char_name_policy : public basic_naming_policy { public: // Constructor char_name_policy(); - BOOST_RT_PARAM_UNNEEDED_VIRTUAL ~char_name_policy() {} + BOOST_TEST_UTILS_RUNTIME_PARAM_UNNEEDED_VIRTUAL ~char_name_policy() {} // policy interface virtual bool conflict_with( identification_policy const& ) const; @@ -47,7 +47,7 @@ public: { basic_naming_policy::accept_modifier( m ); - BOOST_RT_PARAM_VALIDATE_LOGIC( p_name->size() <= 1, "Invalid parameter name " << p_name ); + BOOST_TEST_UTILS_RUNTIME_PARAM_VALIDATE_LOGIC( p_name->size() <= 1, "Invalid parameter name " << p_name ); } }; @@ -84,15 +84,17 @@ char_parameter( char_type name ) } // namespace cla -} // namespace BOOST_RT_PARAM_NAMESPACE +} // namespace BOOST_TEST_UTILS_RUNTIME_PARAM_NAMESPACE } // namespace boost -#ifndef BOOST_RT_PARAM_OFFLINE +#ifndef BOOST_TEST_UTILS_RUNTIME_PARAM_OFFLINE -# define BOOST_RT_PARAM_INLINE inline -# include <boost/test/utils/runtime/cla/char_parameter.ipp> +#ifndef BOOST_TEST_UTILS_RUNTIME_PARAM_INLINE +# define BOOST_TEST_UTILS_RUNTIME_PARAM_INLINE inline +#endif +# include <boost/test/utils/runtime/cla/char_parameter.ipp> #endif -#endif // BOOST_RT_CLA_CHAR_PARAMETER_HPP_062604GER +#endif // BOOST_TEST_UTILS_RUNTIME_CLA_CHAR_PARAMETER_HPP diff --git a/boost/test/utils/runtime/cla/char_parameter.ipp b/boost/test/utils/runtime/cla/char_parameter.ipp index db4d0c1ed1..398ce79ac4 100644 --- a/boost/test/utils/runtime/cla/char_parameter.ipp +++ b/boost/test/utils/runtime/cla/char_parameter.ipp @@ -1,6 +1,6 @@ -// (C) Copyright Gennadiy Rozental 2005-2008. -// Use, modification, and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file +// (C) Copyright Gennadiy Rozental 2005-2014. +// Use, modification, and distribution are subject to 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) // See http://www.boost.org/libs/test for the library home page. @@ -12,8 +12,8 @@ // Description : implements model of parameter with single char name // *************************************************************************** -#ifndef BOOST_RT_CLA_CHAR_PARAMETER_IPP_062904GER -#define BOOST_RT_CLA_CHAR_PARAMETER_IPP_062904GER +#ifndef BOOST_TEST_UTILS_RUNTIME_CLA_CHAR_PARAMETER_IPP +#define BOOST_TEST_UTILS_RUNTIME_CLA_CHAR_PARAMETER_IPP // Boost.Runtime.Parameter #include <boost/test/utils/runtime/config.hpp> @@ -22,7 +22,7 @@ namespace boost { -namespace BOOST_RT_PARAM_NAMESPACE { +namespace BOOST_TEST_UTILS_RUNTIME_PARAM_NAMESPACE { namespace cla { @@ -30,19 +30,19 @@ namespace cla { // ************** char_name_policy ************** // // ************************************************************************** // -BOOST_RT_PARAM_INLINE +BOOST_TEST_UTILS_RUNTIME_PARAM_INLINE char_name_policy::char_name_policy() : basic_naming_policy( rtti::type_id<char_name_policy>() ) { - assign_op( p_prefix.value, BOOST_RT_PARAM_CSTRING_LITERAL( "-" ), 0 ); + assign_op( p_prefix.value, BOOST_TEST_UTILS_RUNTIME_PARAM_CSTRING_LITERAL( "-" ), 0 ); } //____________________________________________________________________________// -BOOST_RT_PARAM_INLINE bool +BOOST_TEST_UTILS_RUNTIME_PARAM_INLINE bool char_name_policy::conflict_with( identification_policy const& id ) const { - return id.p_type_id == p_type_id && + return id.p_type_id == p_type_id && p_name == static_cast<char_name_policy const&>( id ).p_name; } @@ -50,8 +50,8 @@ char_name_policy::conflict_with( identification_policy const& id ) const } // namespace cla -} // namespace BOOST_RT_PARAM_NAMESPACE +} // namespace BOOST_TEST_UTILS_RUNTIME_PARAM_NAMESPACE } // namespace boost -#endif // BOOST_RT_CLA_CHAR_PARAMETER_IPP_062904GER +#endif // BOOST_TEST_UTILS_RUNTIME_CLA_CHAR_PARAMETER_IPP diff --git a/boost/test/utils/runtime/cla/detail/argument_value_usage.hpp b/boost/test/utils/runtime/cla/detail/argument_value_usage.hpp index 0d59595612..a70b6d1fb7 100644 --- a/boost/test/utils/runtime/cla/detail/argument_value_usage.hpp +++ b/boost/test/utils/runtime/cla/detail/argument_value_usage.hpp @@ -1,10 +1,9 @@ -// (C) Copyright Gennadiy Rozental 2005-2008. -// Permission to copy, use, modify, sell and distribute this software -// is granted provided this copyright notice appears in all copies. -// This software is provided "as is" without express or implied warranty, -// and with no claim as to its suitability for any purpose. - -// See http://www.boost.org for updates, documentation, and revision history. +// (C) Copyright Gennadiy Rozental 2005-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) + +// See http://www.boost.org/libs/test for the library home page. // // File : $RCSfile$ // @@ -13,8 +12,8 @@ // Description : argument usage printing helpers // *************************************************************************** -#ifndef BOOST_RT_CLA_ARGUMENT_VALUE_USAGE_HPP_062604GER -#define BOOST_RT_CLA_ARGUMENT_VALUE_USAGE_HPP_062604GER +#ifndef BOOST_TEST_UTILS_RUNTIME_CLA_ARGUMENT_VALUE_USAGE_HPP +#define BOOST_TEST_UTILS_RUNTIME_CLA_ARGUMENT_VALUE_USAGE_HPP // Boost.Runtime.Parameter #include <boost/test/utils/runtime/config.hpp> @@ -32,7 +31,7 @@ namespace boost { -namespace BOOST_RT_PARAM_NAMESPACE { +namespace BOOST_TEST_UTILS_RUNTIME_PARAM_NAMESPACE { namespace cla { @@ -47,7 +46,7 @@ template<typename T> inline void argument_value_usage( format_stream& fs, long, T* = 0 ) { - fs << BOOST_RT_PARAM_CSTRING_LITERAL( "<value>" ); + fs << BOOST_TEST_UTILS_RUNTIME_PARAM_CSTRING_LITERAL( "<value>" ); } //____________________________________________________________________________// @@ -57,7 +56,7 @@ template<typename T> inline void argument_value_usage( format_stream& fs, int, std::list<T>* = 0 ) { - fs << BOOST_RT_PARAM_CSTRING_LITERAL( "(<value1>, ..., <valueN>)" ); + fs << BOOST_TEST_UTILS_RUNTIME_PARAM_CSTRING_LITERAL( "(<value1>, ..., <valueN>)" ); } //____________________________________________________________________________// @@ -66,7 +65,7 @@ argument_value_usage( format_stream& fs, int, std::list<T>* = 0 ) inline void argument_value_usage( format_stream& fs, int, bool* = 0 ) { - fs << BOOST_RT_PARAM_CSTRING_LITERAL( "yes|y|no|n" ); + fs << BOOST_TEST_UTILS_RUNTIME_PARAM_CSTRING_LITERAL( "yes|y|no|n" ); } //____________________________________________________________________________// @@ -75,8 +74,8 @@ argument_value_usage( format_stream& fs, int, bool* = 0 ) } // namespace cla -} // namespace BOOST_RT_PARAM_NAMESPACE +} // namespace BOOST_TEST_UTILS_RUNTIME_PARAM_NAMESPACE } // namespace boost -#endif // BOOST_RT_CLA_ARGUMENT_VALUE_USAGE_HPP_062604GER +#endif // BOOST_TEST_UTILS_RUNTIME_CLA_ARGUMENT_VALUE_USAGE_HPP diff --git a/boost/test/utils/runtime/cla/dual_name_parameter.cpp b/boost/test/utils/runtime/cla/dual_name_parameter.cpp index c715de349e..ab034ff04c 100644 --- a/boost/test/utils/runtime/cla/dual_name_parameter.cpp +++ b/boost/test/utils/runtime/cla/dual_name_parameter.cpp @@ -1,6 +1,6 @@ -// (C) Copyright Gennadiy Rozental 2005-2008. -// Use, modification, and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file +// (C) Copyright Gennadiy Rozental 2005-2014. +// Use, modification, and distribution are subject to 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) // See http://www.boost.org/libs/test for the library home page. @@ -12,5 +12,5 @@ // Description : offline implementation of generic parameter with dual naming // *************************************************************************** -#define BOOST_RT_PARAM_INLINE +#define BOOST_TEST_UTILS_RUNTIME_PARAM_INLINE #include <boost/test/utils/runtime/cla/dual_name_parameter.ipp> diff --git a/boost/test/utils/runtime/cla/dual_name_parameter.hpp b/boost/test/utils/runtime/cla/dual_name_parameter.hpp index 26ac657c86..789b67ad1d 100644 --- a/boost/test/utils/runtime/cla/dual_name_parameter.hpp +++ b/boost/test/utils/runtime/cla/dual_name_parameter.hpp @@ -1,6 +1,6 @@ -// (C) Copyright Gennadiy Rozental 2005-2008. -// Use, modification, and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file +// (C) Copyright Gennadiy Rozental 2005-2014. +// Use, modification, and distribution are subject to 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) // See http://www.boost.org/libs/test for the library home page. @@ -12,8 +12,8 @@ // Description : defines model of generic parameter with dual naming // *************************************************************************** -#ifndef BOOST_RT_CLA_DUAL_NAME_PARAMETER_HPP_062604GER -#define BOOST_RT_CLA_DUAL_NAME_PARAMETER_HPP_062604GER +#ifndef BOOST_TEST_UTILS_RUNTIME_CLA_DUAL_NAME_PARAMETER_HPP +#define BOOST_TEST_UTILS_RUNTIME_CLA_DUAL_NAME_PARAMETER_HPP // Boost.Runtime.Parameter #include <boost/test/utils/runtime/config.hpp> @@ -23,7 +23,7 @@ namespace boost { -namespace BOOST_RT_PARAM_NAMESPACE { +namespace BOOST_TEST_UTILS_RUNTIME_PARAM_NAMESPACE { namespace cla { @@ -76,21 +76,23 @@ public: //____________________________________________________________________________// -BOOST_RT_CLA_NAMED_PARAM_GENERATORS( dual_name_parameter ) +BOOST_TEST_UTILS_RUNTIME_CLA_NAMED_PARAM_GENERATORS( dual_name_parameter ) //____________________________________________________________________________// } // namespace cla -} // namespace BOOST_RT_PARAM_NAMESPACE +} // namespace BOOST_TEST_UTILS_RUNTIME_PARAM_NAMESPACE } // namespace boost -#ifndef BOOST_RT_PARAM_OFFLINE +#ifndef BOOST_TEST_UTILS_RUNTIME_PARAM_OFFLINE -# define BOOST_RT_PARAM_INLINE inline -# include <boost/test/utils/runtime/cla/dual_name_parameter.ipp> +#ifndef BOOST_TEST_UTILS_RUNTIME_PARAM_INLINE +# define BOOST_TEST_UTILS_RUNTIME_PARAM_INLINE inline +#endif +# include <boost/test/utils/runtime/cla/dual_name_parameter.ipp> #endif -#endif // BOOST_RT_CLA_DUAL_NAME_PARAMETER_HPP_062604GER +#endif // BOOST_TEST_UTILS_RUNTIME_CLA_DUAL_NAME_PARAMETER_HPP diff --git a/boost/test/utils/runtime/cla/dual_name_parameter.ipp b/boost/test/utils/runtime/cla/dual_name_parameter.ipp index 6e3a37f58d..e39d132d62 100644 --- a/boost/test/utils/runtime/cla/dual_name_parameter.ipp +++ b/boost/test/utils/runtime/cla/dual_name_parameter.ipp @@ -1,6 +1,6 @@ -// (C) Copyright Gennadiy Rozental 2005-2008. -// Use, modification, and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file +// (C) Copyright Gennadiy Rozental 2005-2014. +// Use, modification, and distribution are subject to 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) // See http://www.boost.org/libs/test for the library home page. @@ -12,8 +12,8 @@ // Description : implements model of generic parameter with dual naming // *************************************************************************** -#ifndef BOOST_RT_CLA_DUAL_NAME_PARAMETER_IPP_062904GER -#define BOOST_RT_CLA_DUAL_NAME_PARAMETER_IPP_062904GER +#ifndef BOOST_TEST_UTILS_RUNTIME_CLA_DUAL_NAME_PARAMETER_IPP +#define BOOST_TEST_UTILS_RUNTIME_CLA_DUAL_NAME_PARAMETER_IPP // Boost.Runtime.Parameter #include <boost/test/utils/runtime/config.hpp> @@ -23,7 +23,7 @@ namespace boost { -namespace BOOST_RT_PARAM_NAMESPACE { +namespace BOOST_TEST_UTILS_RUNTIME_PARAM_NAMESPACE { namespace cla { @@ -31,11 +31,11 @@ namespace cla { // ************** dual_name_policy ************** // // ************************************************************************** // -BOOST_RT_PARAM_INLINE +BOOST_TEST_UTILS_RUNTIME_PARAM_INLINE dual_name_policy::dual_name_policy() { - m_primary.accept_modifier( prefix = BOOST_RT_PARAM_CSTRING_LITERAL( "--" ) ); - m_secondary.accept_modifier( prefix = BOOST_RT_PARAM_CSTRING_LITERAL( "-" ) ); + m_primary.accept_modifier( prefix = BOOST_TEST_UTILS_RUNTIME_PARAM_CSTRING_LITERAL( "--" ) ); + m_secondary.accept_modifier( prefix = BOOST_TEST_UTILS_RUNTIME_PARAM_CSTRING_LITERAL( "-" ) ); } //____________________________________________________________________________// @@ -46,8 +46,8 @@ template<typename K> inline void split( string_name_policy& snp, char_name_policy& cnp, cstring src, K const& k ) { - cstring::iterator sep = std::find( src.begin(), src.end(), BOOST_RT_PARAM_LITERAL( '|' ) ); - + cstring::iterator sep = std::find( src.begin(), src.end(), BOOST_TEST_UTILS_RUNTIME_PARAM_LITERAL( '|' ) ); + if( sep != src.begin() ) snp.accept_modifier( k = cstring( src.begin(), sep ) ); @@ -57,7 +57,7 @@ split( string_name_policy& snp, char_name_policy& cnp, cstring src, K const& k ) } // local namespace -BOOST_RT_PARAM_INLINE void +BOOST_TEST_UTILS_RUNTIME_PARAM_INLINE void dual_name_policy::set_prefix( cstring src ) { split( m_primary, m_secondary, src, prefix ); @@ -65,7 +65,7 @@ dual_name_policy::set_prefix( cstring src ) //____________________________________________________________________________// -BOOST_RT_PARAM_INLINE void +BOOST_TEST_UTILS_RUNTIME_PARAM_INLINE void dual_name_policy::set_name( cstring src ) { split( m_primary, m_secondary, src, name ); @@ -73,7 +73,7 @@ dual_name_policy::set_name( cstring src ) //____________________________________________________________________________// -BOOST_RT_PARAM_INLINE void +BOOST_TEST_UTILS_RUNTIME_PARAM_INLINE void dual_name_policy::set_separator( cstring src ) { split( m_primary, m_secondary, src, separator ); @@ -83,8 +83,8 @@ dual_name_policy::set_separator( cstring src ) } // namespace cla -} // namespace BOOST_RT_PARAM_NAMESPACE +} // namespace BOOST_TEST_UTILS_RUNTIME_PARAM_NAMESPACE } // namespace boost -#endif // BOOST_RT_CLA_DUAL_NAME_PARAMETER_IPP_062904GER +#endif // BOOST_TEST_UTILS_RUNTIME_CLA_DUAL_NAME_PARAMETER_IPP diff --git a/boost/test/utils/runtime/cla/fwd.hpp b/boost/test/utils/runtime/cla/fwd.hpp index b5039339d8..df02974345 100644 --- a/boost/test/utils/runtime/cla/fwd.hpp +++ b/boost/test/utils/runtime/cla/fwd.hpp @@ -1,6 +1,6 @@ -// (C) Copyright Gennadiy Rozental 2005-2008. -// Use, modification, and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file +// (C) Copyright Gennadiy Rozental 2005-2014. +// Use, modification, and distribution are subject to 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) // See http://www.boost.org/libs/test for the library home page. @@ -12,8 +12,8 @@ // Description : cla subsystem forward declarations // *************************************************************************** -#ifndef BOOST_RT_CLA_FWD_HPP_062604GER -#define BOOST_RT_CLA_FWD_HPP_062604GER +#ifndef BOOST_TEST_UTILS_RUNTIME_CLA_FWD_HPP +#define BOOST_TEST_UTILS_RUNTIME_CLA_FWD_HPP // Boost.Runtime.Parameter #include <boost/test/utils/runtime/config.hpp> @@ -23,7 +23,7 @@ namespace boost { -namespace BOOST_RT_PARAM_NAMESPACE { +namespace BOOST_TEST_UTILS_RUNTIME_PARAM_NAMESPACE { namespace cla { @@ -48,8 +48,8 @@ class positional_parameter_base; } // namespace cla -} // namespace BOOST_RT_PARAM_NAMESPACE +} // namespace BOOST_TEST_UTILS_RUNTIME_PARAM_NAMESPACE } // namespace boost -#endif // BOOST_RT_CLA_FWD_HPP_062604GER +#endif // BOOST_TEST_UTILS_RUNTIME_CLA_FWD_HPP diff --git a/boost/test/utils/runtime/cla/id_policy.cpp b/boost/test/utils/runtime/cla/id_policy.cpp index c3a5ab8273..b000e26f94 100644 --- a/boost/test/utils/runtime/cla/id_policy.cpp +++ b/boost/test/utils/runtime/cla/id_policy.cpp @@ -1,6 +1,6 @@ -// (C) Copyright Gennadiy Rozental 2005-2008. -// Use, modification, and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file +// (C) Copyright Gennadiy Rozental 2005-2014. +// Use, modification, and distribution are subject to 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) // See http://www.boost.org/libs/test for the library home page. @@ -12,5 +12,5 @@ // Description : some generic identification policies offline implementation // *************************************************************************** -#define BOOST_RT_PARAM_INLINE +#define BOOST_TEST_UTILS_RUNTIME_PARAM_INLINE #include <boost/test/utils/runtime/cla/id_policy.ipp> diff --git a/boost/test/utils/runtime/cla/id_policy.hpp b/boost/test/utils/runtime/cla/id_policy.hpp index 596805ea21..3308b07c61 100644 --- a/boost/test/utils/runtime/cla/id_policy.hpp +++ b/boost/test/utils/runtime/cla/id_policy.hpp @@ -1,4 +1,4 @@ -// (C) Copyright Gennadiy Rozental 2005-2008. +// (C) Copyright Gennadiy Rozental 2005-2014. // Use, modification, and distribution are subject to 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) @@ -12,8 +12,8 @@ // Description : some generic identification policies definition // *************************************************************************** -#ifndef BOOST_RT_CLA_ID_POLICY_HPP_062604GER -#define BOOST_RT_CLA_ID_POLICY_HPP_062604GER +#ifndef BOOST_TEST_UTILS_RUNTIME_CLA_ID_POLICY_HPP +#define BOOST_TEST_UTILS_RUNTIME_CLA_ID_POLICY_HPP // Boost.Runtime.Parameter #include <boost/test/utils/runtime/config.hpp> @@ -30,7 +30,7 @@ namespace boost { -namespace BOOST_RT_PARAM_NAMESPACE { +namespace BOOST_TEST_UTILS_RUNTIME_PARAM_NAMESPACE { namespace cla { @@ -65,7 +65,7 @@ protected: explicit basic_naming_policy( rtti::id_t dyn_type ) : identification_policy( dyn_type ) {} - BOOST_RT_PARAM_UNNEEDED_VIRTUAL ~basic_naming_policy() {} + BOOST_TEST_UTILS_RUNTIME_PARAM_UNNEEDED_VIRTUAL ~basic_naming_policy() {} // Naming policy interface virtual bool match_prefix( argv_traverser& tr ) const; @@ -102,11 +102,11 @@ public: } virtual void usage_info( format_stream& fs ) const { - fs << BOOST_RT_PARAM_LITERAL( '{' ); + fs << BOOST_TEST_UTILS_RUNTIME_PARAM_LITERAL( '{' ); m_primary.usage_info( fs ); - fs << BOOST_RT_PARAM_LITERAL( '|' ); + fs << BOOST_TEST_UTILS_RUNTIME_PARAM_LITERAL( '|' ); m_secondary.usage_info( fs ); - fs << BOOST_RT_PARAM_LITERAL( '}' ); + fs << BOOST_TEST_UTILS_RUNTIME_PARAM_LITERAL( '}' ); } virtual bool matching( parameter const& p, argv_traverser& tr, bool primary ) const { @@ -122,7 +122,7 @@ public: } protected: - BOOST_RT_PARAM_UNNEEDED_VIRTUAL ~dual_id_policy() {} + BOOST_TEST_UTILS_RUNTIME_PARAM_UNNEEDED_VIRTUAL ~dual_id_policy() {} // Data members PrimaryId m_primary; @@ -131,15 +131,17 @@ protected: } // namespace cla -} // namespace BOOST_RT_PARAM_NAMESPACE +} // namespace BOOST_TEST_UTILS_RUNTIME_PARAM_NAMESPACE } // namespace boost -#ifndef BOOST_RT_PARAM_OFFLINE +#ifndef BOOST_TEST_UTILS_RUNTIME_PARAM_OFFLINE -# define BOOST_RT_PARAM_INLINE inline -# include <boost/test/utils/runtime/cla/id_policy.ipp> +#ifndef BOOST_TEST_UTILS_RUNTIME_PARAM_INLINE +# define BOOST_TEST_UTILS_RUNTIME_PARAM_INLINE inline +#endif +# include <boost/test/utils/runtime/cla/id_policy.ipp> #endif -#endif // BOOST_RT_CLA_ID_POLICY_HPP_062604GER +#endif // BOOST_TEST_UTILS_RUNTIME_CLA_ID_POLICY_HPP diff --git a/boost/test/utils/runtime/cla/id_policy.ipp b/boost/test/utils/runtime/cla/id_policy.ipp index 5498b9a8d0..879ccfd1e1 100644 --- a/boost/test/utils/runtime/cla/id_policy.ipp +++ b/boost/test/utils/runtime/cla/id_policy.ipp @@ -1,6 +1,6 @@ -// (C) Copyright Gennadiy Rozental 2005-2008. -// Use, modification, and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file +// (C) Copyright Gennadiy Rozental 2005-2014. +// Use, modification, and distribution are subject to 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) // See http://www.boost.org/libs/test for the library home page. @@ -12,8 +12,8 @@ // Description : some generic identification policies implementation // *************************************************************************** -#ifndef BOOST_RT_CLA_ID_POLICY_IPP_062904GER -#define BOOST_RT_CLA_ID_POLICY_IPP_062904GER +#ifndef BOOST_TEST_UTILS_RUNTIME_CLA_ID_POLICY_IPP +#define BOOST_TEST_UTILS_RUNTIME_CLA_ID_POLICY_IPP // Boost.Runtime.Parameter #include <boost/test/utils/runtime/config.hpp> @@ -23,7 +23,7 @@ namespace boost { -namespace BOOST_RT_PARAM_NAMESPACE { +namespace BOOST_TEST_UTILS_RUNTIME_PARAM_NAMESPACE { namespace cla { @@ -31,18 +31,18 @@ namespace cla { // ************** basic_naming_policy ************** // // ************************************************************************** // -BOOST_RT_PARAM_INLINE void +BOOST_TEST_UTILS_RUNTIME_PARAM_INLINE void basic_naming_policy::usage_info( format_stream& fs ) const { fs << p_prefix << p_name << p_separator; if( p_separator->empty() ) - fs << BOOST_RT_PARAM_LITERAL( ' ' ); + fs << BOOST_TEST_UTILS_RUNTIME_PARAM_LITERAL( ' ' ); } //____________________________________________________________________________// -BOOST_RT_PARAM_INLINE bool +BOOST_TEST_UTILS_RUNTIME_PARAM_INLINE bool basic_naming_policy::match_prefix( argv_traverser& tr ) const { if( !tr.match_front( p_prefix.get() ) ) @@ -53,8 +53,8 @@ basic_naming_policy::match_prefix( argv_traverser& tr ) const } //____________________________________________________________________________// - -BOOST_RT_PARAM_INLINE bool + +BOOST_TEST_UTILS_RUNTIME_PARAM_INLINE bool basic_naming_policy::match_name( argv_traverser& tr ) const { if( !tr.match_front( p_name.get() ) ) @@ -65,8 +65,8 @@ basic_naming_policy::match_name( argv_traverser& tr ) const } //____________________________________________________________________________// - -BOOST_RT_PARAM_INLINE bool + +BOOST_TEST_UTILS_RUNTIME_PARAM_INLINE bool basic_naming_policy::match_separator( argv_traverser& tr, bool optional_value ) const { if( p_separator->empty() ) { @@ -92,12 +92,12 @@ basic_naming_policy::match_separator( argv_traverser& tr, bool optional_value ) //____________________________________________________________________________// -BOOST_RT_PARAM_INLINE bool +BOOST_TEST_UTILS_RUNTIME_PARAM_INLINE bool basic_naming_policy::matching( parameter const& p, argv_traverser& tr, bool ) const { if( !match_prefix( tr ) ) return false; - + if( !match_name( tr ) ) return false; @@ -111,8 +111,8 @@ basic_naming_policy::matching( parameter const& p, argv_traverser& tr, bool ) co } // namespace cla -} // namespace BOOST_RT_PARAM_NAMESPACE +} // namespace BOOST_TEST_UTILS_RUNTIME_PARAM_NAMESPACE } // namespace boost -#endif // BOOST_RT_CLA_ID_POLICY_IPP_062904GER +#endif // BOOST_TEST_UTILS_RUNTIME_CLA_ID_POLICY_IPP diff --git a/boost/test/utils/runtime/cla/iface/argument_factory.hpp b/boost/test/utils/runtime/cla/iface/argument_factory.hpp index 03669e0cc0..cbca713bd3 100644 --- a/boost/test/utils/runtime/cla/iface/argument_factory.hpp +++ b/boost/test/utils/runtime/cla/iface/argument_factory.hpp @@ -1,6 +1,6 @@ -// (C) Copyright Gennadiy Rozental 2005-2008. -// Use, modification, and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file +// (C) Copyright Gennadiy Rozental 2005-2014. +// Use, modification, and distribution are subject to 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) // See http://www.boost.org/libs/test for the library home page. @@ -12,8 +12,8 @@ // Description : defines interface for argument_factory // *************************************************************************** -#ifndef BOOST_RT_CLA_IFACE_ARGUMENT_FACTORY_HPP_062604GER -#define BOOST_RT_CLA_IFACE_ARGUMENT_FACTORY_HPP_062604GER +#ifndef BOOST_TEST_UTILS_RUNTIME_CLA_IFACE_ARGUMENT_FACTORY_HPP +#define BOOST_TEST_UTILS_RUNTIME_CLA_IFACE_ARGUMENT_FACTORY_HPP // Boost.Runtime.Parameter #include <boost/test/utils/runtime/config.hpp> @@ -23,7 +23,7 @@ namespace boost { -namespace BOOST_RT_PARAM_NAMESPACE { +namespace BOOST_TEST_UTILS_RUNTIME_PARAM_NAMESPACE { namespace cla { @@ -44,8 +44,8 @@ protected: } // namespace boost -} // namespace BOOST_RT_PARAM_NAMESPACE +} // namespace BOOST_TEST_UTILS_RUNTIME_PARAM_NAMESPACE } // namespace cla -#endif // BOOST_RT_CLA_IFACE_ARGUMENT_FACTORY_HPP_062604GER +#endif // BOOST_TEST_UTILS_RUNTIME_CLA_IFACE_ARGUMENT_FACTORY_HPP diff --git a/boost/test/utils/runtime/cla/iface/id_policy.hpp b/boost/test/utils/runtime/cla/iface/id_policy.hpp index 1e2d684c25..5fa13e6bc7 100644 --- a/boost/test/utils/runtime/cla/iface/id_policy.hpp +++ b/boost/test/utils/runtime/cla/iface/id_policy.hpp @@ -1,4 +1,4 @@ -// (C) Copyright Gennadiy Rozental 2005-2008. +// (C) Copyright Gennadiy Rozental 2005-2014. // Use, modification, and distribution are subject to 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) @@ -12,8 +12,8 @@ // Description : defines interface for identification_policy // *************************************************************************** -#ifndef BOOST_RT_CLA_IFACE_ID_POLICY_HPP_062604GER -#define BOOST_RT_CLA_IFACE_ID_POLICY_HPP_062604GER +#ifndef BOOST_TEST_UTILS_RUNTIME_CLA_IFACE_ID_POLICY_HPP +#define BOOST_TEST_UTILS_RUNTIME_CLA_IFACE_ID_POLICY_HPP // Boost.Runtime.Parameter #include <boost/test/utils/runtime/config.hpp> @@ -26,7 +26,7 @@ namespace boost { -namespace BOOST_RT_PARAM_NAMESPACE { +namespace BOOST_TEST_UTILS_RUNTIME_PARAM_NAMESPACE { namespace cla { @@ -66,8 +66,8 @@ protected: } // namespace cla -} // namespace BOOST_RT_PARAM_NAMESPACE +} // namespace BOOST_TEST_UTILS_RUNTIME_PARAM_NAMESPACE } // namespace boost -#endif // BOOST_RT_CLA_IFACE_ID_POLICY_HPP_062604GER +#endif // BOOST_TEST_UTILS_RUNTIME_CLA_IFACE_ID_POLICY_HPP diff --git a/boost/test/utils/runtime/cla/modifier.hpp b/boost/test/utils/runtime/cla/modifier.hpp index 08924e2f94..4b55536b73 100644 --- a/boost/test/utils/runtime/cla/modifier.hpp +++ b/boost/test/utils/runtime/cla/modifier.hpp @@ -1,6 +1,6 @@ -// (C) Copyright Gennadiy Rozental 2005-2008. -// Use, modification, and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file +// (C) Copyright Gennadiy Rozental 2005-2014. +// Use, modification, and distribution are subject to 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) // See http://www.boost.org/libs/test for the library home page. @@ -12,8 +12,8 @@ // Description : parameter modifiers // *************************************************************************** -#ifndef BOOST_RT_CLA_MODIFIER_HPP_062604GER -#define BOOST_RT_CLA_MODIFIER_HPP_062604GER +#ifndef BOOST_TEST_UTILS_RUNTIME_CLA_MODIFIER_HPP +#define BOOST_TEST_UTILS_RUNTIME_CLA_MODIFIER_HPP // Boost.Runtime.Parameter #include <boost/test/utils/runtime/config.hpp> @@ -23,7 +23,7 @@ namespace boost { -namespace BOOST_RT_PARAM_NAMESPACE { +namespace BOOST_TEST_UTILS_RUNTIME_PARAM_NAMESPACE { namespace cla { @@ -62,8 +62,8 @@ nfp::keyword<struct assign_to_t> assign_to; } // namespace cla -} // namespace BOOST_RT_PARAM_NAMESPACE +} // namespace BOOST_TEST_UTILS_RUNTIME_PARAM_NAMESPACE } // namespace boost -#endif // BOOST_RT_CLA_MODIFIER_HPP_062604GER +#endif // BOOST_TEST_UTILS_RUNTIME_CLA_MODIFIER_HPP diff --git a/boost/test/utils/runtime/cla/named_parameter.cpp b/boost/test/utils/runtime/cla/named_parameter.cpp index 1b91059fd0..7e94722dc9 100644 --- a/boost/test/utils/runtime/cla/named_parameter.cpp +++ b/boost/test/utils/runtime/cla/named_parameter.cpp @@ -1,6 +1,6 @@ -// (C) Copyright Gennadiy Rozental 2005-2008. -// Use, modification, and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file +// (C) Copyright Gennadiy Rozental 2005-2014. +// Use, modification, and distribution are subject to 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) // See http://www.boost.org/libs/test for the library home page. @@ -12,5 +12,5 @@ // Description : offline implementation of named parameter // *************************************************************************** -#define BOOST_RT_PARAM_INLINE +#define BOOST_TEST_UTILS_RUNTIME_PARAM_INLINE #include <boost/test/utils/runtime/cla/named_parameter.ipp> diff --git a/boost/test/utils/runtime/cla/named_parameter.hpp b/boost/test/utils/runtime/cla/named_parameter.hpp index 9f0ac1dae0..be3f9c570b 100644 --- a/boost/test/utils/runtime/cla/named_parameter.hpp +++ b/boost/test/utils/runtime/cla/named_parameter.hpp @@ -1,6 +1,6 @@ -// (C) Copyright Gennadiy Rozental 2005-2008. -// Use, modification, and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file +// (C) Copyright Gennadiy Rozental 2005-2014. +// Use, modification, and distribution are subject to 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) // See http://www.boost.org/libs/test for the library home page. @@ -12,8 +12,8 @@ // Description : defines model of named parameter // *************************************************************************** -#ifndef BOOST_RT_CLA_NAMED_PARAMETER_HPP_062604GER -#define BOOST_RT_CLA_NAMED_PARAMETER_HPP_062604GER +#ifndef BOOST_TEST_UTILS_RUNTIME_CLA_NAMED_PARAMETER_HPP +#define BOOST_TEST_UTILS_RUNTIME_CLA_NAMED_PARAMETER_HPP // Boost.Runtime.Parameter #include <boost/test/utils/runtime/config.hpp> @@ -23,7 +23,7 @@ namespace boost { -namespace BOOST_RT_PARAM_NAMESPACE { +namespace BOOST_TEST_UTILS_RUNTIME_PARAM_NAMESPACE { namespace cla { @@ -35,7 +35,7 @@ class string_name_policy : public basic_naming_policy { public: // Constructor string_name_policy(); - BOOST_RT_PARAM_UNNEEDED_VIRTUAL ~string_name_policy() {} + BOOST_TEST_UTILS_RUNTIME_PARAM_UNNEEDED_VIRTUAL ~string_name_policy() {} // policy interface virtual bool responds_to( cstring name ) const; @@ -73,21 +73,23 @@ public: //____________________________________________________________________________// -BOOST_RT_CLA_NAMED_PARAM_GENERATORS( named_parameter ) +BOOST_TEST_UTILS_RUNTIME_CLA_NAMED_PARAM_GENERATORS( named_parameter ) //____________________________________________________________________________// } // namespace cla -} // namespace BOOST_RT_PARAM_NAMESPACE +} // namespace BOOST_TEST_UTILS_RUNTIME_PARAM_NAMESPACE } // namespace boost -#ifndef BOOST_RT_PARAM_OFFLINE +#ifndef BOOST_TEST_UTILS_RUNTIME_PARAM_OFFLINE -# define BOOST_RT_PARAM_INLINE inline -# include <boost/test/utils/runtime/cla/named_parameter.ipp> +#ifndef BOOST_TEST_UTILS_RUNTIME_PARAM_INLINE +# define BOOST_TEST_UTILS_RUNTIME_PARAM_INLINE inline +#endif +# include <boost/test/utils/runtime/cla/named_parameter.ipp> #endif -#endif // BOOST_RT_CLA_NAMED_PARAMETER_HPP_062604GER +#endif // BOOST_TEST_UTILS_RUNTIME_CLA_NAMED_PARAMETER_HPP diff --git a/boost/test/utils/runtime/cla/named_parameter.ipp b/boost/test/utils/runtime/cla/named_parameter.ipp index e04348f53b..e59ebdf89c 100644 --- a/boost/test/utils/runtime/cla/named_parameter.ipp +++ b/boost/test/utils/runtime/cla/named_parameter.ipp @@ -1,6 +1,6 @@ -// (C) Copyright Gennadiy Rozental 2005-2008. -// Use, modification, and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file +// (C) Copyright Gennadiy Rozental 2005-2014. +// Use, modification, and distribution are subject to 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) // See http://www.boost.org/libs/test for the library home page. @@ -12,8 +12,8 @@ // Description : implements model of named parameter // *************************************************************************** -#ifndef BOOST_RT_CLA_NAMED_PARAMETER_IPP_062904GER -#define BOOST_RT_CLA_NAMED_PARAMETER_IPP_062904GER +#ifndef BOOST_TEST_UTILS_RUNTIME_CLA_NAMED_PARAMETER_IPP +#define BOOST_TEST_UTILS_RUNTIME_CLA_NAMED_PARAMETER_IPP // Boost.Runtime.Parameter #include <boost/test/utils/runtime/config.hpp> @@ -26,7 +26,7 @@ namespace boost { -namespace BOOST_RT_PARAM_NAMESPACE { +namespace BOOST_TEST_UTILS_RUNTIME_PARAM_NAMESPACE { namespace cla { @@ -34,17 +34,17 @@ namespace cla { // ************** string_name_policy ************** // // ************************************************************************** // -BOOST_RT_PARAM_INLINE +BOOST_TEST_UTILS_RUNTIME_PARAM_INLINE string_name_policy::string_name_policy() : basic_naming_policy( rtti::type_id<string_name_policy>() ) , m_guess_name( false ) { - assign_op( p_prefix.value, BOOST_RT_PARAM_CSTRING_LITERAL( "-" ), 0 ); + assign_op( p_prefix.value, BOOST_TEST_UTILS_RUNTIME_PARAM_CSTRING_LITERAL( "-" ), 0 ); } //____________________________________________________________________________// -BOOST_RT_PARAM_INLINE bool +BOOST_TEST_UTILS_RUNTIME_PARAM_INLINE bool string_name_policy::responds_to( cstring name ) const { std::pair<cstring::iterator,dstring::const_iterator> mm_pos; @@ -61,7 +61,7 @@ string_name_policy::responds_to( cstring name ) const # pragma warning(disable:4244) #endif -BOOST_RT_PARAM_INLINE bool +BOOST_TEST_UTILS_RUNTIME_PARAM_INLINE bool string_name_policy::conflict_with( identification_policy const& id ) const { if( id.p_type_id == p_type_id ) { @@ -80,16 +80,16 @@ string_name_policy::conflict_with( identification_policy const& id ) const ((m_guess_name && (mm_pos.second == snp.p_name->end()) ) || // that match other guy and I am guessing (snp.m_guess_name && (mm_pos.first == p_name->end()) )); // or me and the other guy is } - + if( id.p_type_id == rtti::type_id<char_name_policy>() ) { char_name_policy const& cnp = static_cast<char_name_policy const&>( id ); - return m_guess_name && - (p_prefix == cnp.p_prefix) && + return m_guess_name && + (p_prefix == cnp.p_prefix) && unit_test::first_char( cstring( p_name ) ) == unit_test::first_char( cstring( cnp.p_name ) ); } - - return false; + + return false; } #ifdef BOOST_MSVC @@ -98,7 +98,7 @@ string_name_policy::conflict_with( identification_policy const& id ) const //____________________________________________________________________________// -BOOST_RT_PARAM_INLINE bool +BOOST_TEST_UTILS_RUNTIME_PARAM_INLINE bool string_name_policy::match_name( argv_traverser& tr ) const { if( !m_guess_name ) @@ -107,13 +107,13 @@ string_name_policy::match_name( argv_traverser& tr ) const cstring in = tr.input(); std::pair<cstring::iterator,dstring::const_iterator> mm_pos; - + mm_pos = unit_test::mismatch( in.begin(), in.end(), p_name->begin(), p_name->end() ); if( mm_pos.first == in.begin() ) return false; - tr.trim( mm_pos.first - in.begin() ); + tr.trim( static_cast<std::size_t>(mm_pos.first - in.begin()) ); return true; } @@ -122,8 +122,8 @@ string_name_policy::match_name( argv_traverser& tr ) const } // namespace cla -} // namespace BOOST_RT_PARAM_NAMESPACE +} // namespace BOOST_TEST_UTILS_RUNTIME_PARAM_NAMESPACE } // namespace boost -#endif // BOOST_RT_CLA_NAMED_PARAMETER_IPP_062904GER +#endif // BOOST_TEST_UTILS_RUNTIME_CLA_NAMED_PARAMETER_IPP diff --git a/boost/test/utils/runtime/cla/parameter.hpp b/boost/test/utils/runtime/cla/parameter.hpp index 25680db087..9e26d25007 100644 --- a/boost/test/utils/runtime/cla/parameter.hpp +++ b/boost/test/utils/runtime/cla/parameter.hpp @@ -1,6 +1,6 @@ -// (C) Copyright Gennadiy Rozental 2005-2008. -// Use, modification, and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file +// (C) Copyright Gennadiy Rozental 2005-2014. +// Use, modification, and distribution are subject to 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) // See http://www.boost.org/libs/test for the library home page. @@ -12,8 +12,8 @@ // Description : defines model of formal parameter // *************************************************************************** -#ifndef BOOST_RT_CLA_PARAMETER_HPP_062604GER -#define BOOST_RT_CLA_PARAMETER_HPP_062604GER +#ifndef BOOST_TEST_UTILS_RUNTIME_CLA_PARAMETER_HPP +#define BOOST_TEST_UTILS_RUNTIME_CLA_PARAMETER_HPP // Boost.Runtime.Parameter #include <boost/test/utils/runtime/config.hpp> @@ -32,7 +32,7 @@ namespace boost { -namespace BOOST_RT_PARAM_NAMESPACE { +namespace BOOST_TEST_UTILS_RUNTIME_PARAM_NAMESPACE { namespace cla { @@ -40,7 +40,7 @@ namespace cla { // ************** runtime::cla::parameter ************** // // ************************************************************************** // -class parameter : public BOOST_RT_PARAM_NAMESPACE::parameter { +class parameter : public BOOST_TEST_UTILS_RUNTIME_PARAM_NAMESPACE::parameter { public: parameter( identification_policy& ID, argument_factory& F, bool optional_value = false ) : p_optional( false ) @@ -78,9 +78,10 @@ public: } // access methods - bool has_argument() const { return m_actual_argument!=0; } + bool has_argument() const { return !!m_actual_argument; } argument const& actual_argument() const { return *m_actual_argument; } argument_ptr actual_argument() { return m_actual_argument; } + void reset() { m_actual_argument.reset(); } // identification interface @@ -88,20 +89,20 @@ public: bool conflict_with( parameter const& p ) const { return (id_2_report() == p.id_2_report() && !id_2_report().is_empty()) || - m_id_policy.conflict_with( p.m_id_policy ) || + m_id_policy.conflict_with( p.m_id_policy ) || ((m_id_policy.p_type_id != p.m_id_policy.p_type_id) && p.m_id_policy.conflict_with( m_id_policy )); } cstring id_2_report() const { return m_id_policy.id_2_report(); } void usage_info( format_stream& fs ) const - { + { m_id_policy.usage_info( fs ); if( p_optional_value ) - fs << BOOST_RT_PARAM_LITERAL( '[' ); + fs << BOOST_TEST_UTILS_RUNTIME_PARAM_LITERAL( '[' ); m_arg_factory.argument_usage_info( fs ); if( p_optional_value ) - fs << BOOST_RT_PARAM_LITERAL( ']' ); + fs << BOOST_TEST_UTILS_RUNTIME_PARAM_LITERAL( ']' ); } // argument match/produce based on input @@ -143,8 +144,8 @@ operator-( shared_ptr<Parameter> p, Modifier const& m ) } // namespace cla -} // namespace BOOST_RT_PARAM_NAMESPACE +} // namespace BOOST_TEST_UTILS_RUNTIME_PARAM_NAMESPACE } // namespace boost -#endif // BOOST_RT_CLA_PARAMETER_HPP_062604GER +#endif // BOOST_TEST_UTILS_RUNTIME_CLA_PARAMETER_HPP diff --git a/boost/test/utils/runtime/cla/parser.cpp b/boost/test/utils/runtime/cla/parser.cpp index 4d1d7afe97..8efc17d3b2 100644 --- a/boost/test/utils/runtime/cla/parser.cpp +++ b/boost/test/utils/runtime/cla/parser.cpp @@ -1,6 +1,6 @@ -// (C) Copyright Gennadiy Rozental 2005-2008. -// Use, modification, and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file +// (C) Copyright Gennadiy Rozental 2005-2014. +// Use, modification, and distribution are subject to 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) // See http://www.boost.org/libs/test for the library home page. @@ -9,10 +9,10 @@ // // Version : $Revision$ // -// Description : offline implementation for parser +// Description : offline implementation for parser // *************************************************************************** #include <boost/test/utils/runtime/config.hpp> -#define BOOST_RT_PARAM_INLINE +#define BOOST_TEST_UTILS_RUNTIME_PARAM_INLINE #include <boost/test/utils/runtime/cla/parser.ipp> diff --git a/boost/test/utils/runtime/cla/parser.hpp b/boost/test/utils/runtime/cla/parser.hpp index f95d26a095..ffe09e4adc 100644 --- a/boost/test/utils/runtime/cla/parser.hpp +++ b/boost/test/utils/runtime/cla/parser.hpp @@ -1,6 +1,6 @@ -// (C) Copyright Gennadiy Rozental 2005-2008. -// Use, modification, and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file +// (C) Copyright Gennadiy Rozental 2005-2014. +// Use, modification, and distribution are subject to 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) // See http://www.boost.org/libs/test for the library home page. @@ -12,8 +12,8 @@ // Description : defines parser - public interface for CLA parsing and accessing // *************************************************************************** -#ifndef BOOST_RT_CLA_PARSER_HPP_062604GER -#define BOOST_RT_CLA_PARSER_HPP_062604GER +#ifndef BOOST_TEST_UTILS_RUNTIME_CLA_PARSER_HPP +#define BOOST_TEST_UTILS_RUNTIME_CLA_PARSER_HPP // Boost.Runtime.Parameter #include <boost/test/utils/runtime/config.hpp> @@ -32,7 +32,7 @@ namespace boost { -namespace BOOST_RT_PARAM_NAMESPACE { +namespace BOOST_TEST_UTILS_RUNTIME_PARAM_NAMESPACE { namespace cla { @@ -76,6 +76,7 @@ private: class parser { public: typedef std::list<parameter_ptr>::const_iterator param_iterator; + typedef std::list<parameter_ptr>::size_type param_size_type; // Constructor explicit parser( cstring program_name = cstring() ); @@ -100,10 +101,12 @@ public: // parameters access param_iterator first_param() const; param_iterator last_param() const; + param_size_type num_params() const { return m_parameters.size(); } + void reset(); // arguments access const_argument_ptr operator[]( cstring string_id ) const; - cstring get( cstring string_id ) const; + cstring get( cstring string_id ) const; template<typename T> T const& get( cstring string_id ) const @@ -139,15 +142,17 @@ private: } // namespace cla -} // namespace BOOST_RT_PARAM_NAMESPACE +} // namespace BOOST_TEST_UTILS_RUNTIME_PARAM_NAMESPACE } // namespace boost -#ifndef BOOST_RT_PARAM_OFFLINE +#ifndef BOOST_TEST_UTILS_RUNTIME_PARAM_OFFLINE -# define BOOST_RT_PARAM_INLINE inline -# include <boost/test/utils/runtime/cla/parser.ipp> +#ifndef BOOST_TEST_UTILS_RUNTIME_PARAM_INLINE +# define BOOST_TEST_UTILS_RUNTIME_PARAM_INLINE inline +#endif +# include <boost/test/utils/runtime/cla/parser.ipp> #endif -#endif // BOOST_RT_CLA_PARSER_HPP_062604GER +#endif // BOOST_TEST_UTILS_RUNTIME_CLA_PARSER_HPP diff --git a/boost/test/utils/runtime/cla/parser.ipp b/boost/test/utils/runtime/cla/parser.ipp index 188d303156..b8a4ca4636 100644 --- a/boost/test/utils/runtime/cla/parser.ipp +++ b/boost/test/utils/runtime/cla/parser.ipp @@ -1,4 +1,4 @@ -// (C) Copyright Gennadiy Rozental 2005-2008. +// (C) Copyright Gennadiy Rozental 2005-2014. // Use, modification, and distribution are subject to 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) @@ -12,8 +12,8 @@ // Description : implements parser - public interface for CLA parsing and accessing // *************************************************************************** -#ifndef BOOST_RT_CLA_PARSER_IPP_062904GER -#define BOOST_RT_CLA_PARSER_IPP_062904GER +#ifndef BOOST_TEST_UTILS_RUNTIME_CLA_PARSER_IPP +#define BOOST_TEST_UTILS_RUNTIME_CLA_PARSER_IPP // Boost.Runtime.Parameter #include <boost/test/utils/runtime/config.hpp> @@ -35,7 +35,7 @@ namespace boost { -namespace BOOST_RT_PARAM_NAMESPACE { +namespace BOOST_TEST_UTILS_RUNTIME_PARAM_NAMESPACE { namespace cla { @@ -43,7 +43,7 @@ namespace cla { // ************** runtime::cla::parser ************** // // ************************************************************************** // -BOOST_RT_PARAM_INLINE +BOOST_TEST_UTILS_RUNTIME_PARAM_INLINE parser::parser( cstring program_name ) { assign_op( m_program_name, program_name, 0 ); @@ -51,7 +51,7 @@ parser::parser( cstring program_name ) //____________________________________________________________________________// -BOOST_RT_PARAM_INLINE parser::param_iterator +BOOST_TEST_UTILS_RUNTIME_PARAM_INLINE parser::param_iterator parser::first_param() const { return m_parameters.begin(); @@ -59,7 +59,7 @@ parser::first_param() const //____________________________________________________________________________// -BOOST_RT_PARAM_INLINE parser::param_iterator +BOOST_TEST_UTILS_RUNTIME_PARAM_INLINE parser::param_iterator parser::last_param() const { return m_parameters.end(); @@ -67,25 +67,25 @@ parser::last_param() const //____________________________________________________________________________// -BOOST_RT_PARAM_INLINE argument const& +BOOST_TEST_UTILS_RUNTIME_PARAM_INLINE argument const& parser::valid_argument( cstring string_id ) const { const_argument_ptr arg = (*this)[string_id]; - BOOST_RT_PARAM_VALIDATE_LOGIC( !!arg, "Actual argument for parameter " << string_id << " is not present" ); + BOOST_TEST_UTILS_RUNTIME_PARAM_VALIDATE_LOGIC( !!arg, "Actual argument for parameter " << string_id << " is not present" ); return *arg; } //____________________________________________________________________________// -BOOST_RT_PARAM_INLINE parser& +BOOST_TEST_UTILS_RUNTIME_PARAM_INLINE parser& parser::operator<<( parameter_ptr new_param ) { BOOST_TEST_FOREACH( parameter_ptr, old_param, m_parameters ) { - BOOST_RT_PARAM_VALIDATE_LOGIC( !old_param->conflict_with( *new_param ), - BOOST_RT_PARAM_LITERAL( "Definition of parameter " ) << new_param->id_2_report() << - BOOST_RT_PARAM_LITERAL( " conflicts with defintion of parameter " ) << old_param->id_2_report() ); + BOOST_TEST_UTILS_RUNTIME_PARAM_VALIDATE_LOGIC( !old_param->conflict_with( *new_param ), + BOOST_TEST_UTILS_RUNTIME_PARAM_LITERAL( "Definition of parameter " ) << new_param->id_2_report() << + BOOST_TEST_UTILS_RUNTIME_PARAM_LITERAL( " conflicts with defintion of parameter " ) << old_param->id_2_report() ); } m_parameters.push_back( new_param ); @@ -95,12 +95,12 @@ parser::operator<<( parameter_ptr new_param ) //____________________________________________________________________________// -BOOST_RT_PARAM_INLINE void +BOOST_TEST_UTILS_RUNTIME_PARAM_INLINE void parser::parse( int& argc, char_type** argv ) { if( m_program_name.empty() ) { m_program_name.assign( argv[0] ); - dstring::size_type pos = m_program_name.find_last_of( BOOST_RT_PARAM_LITERAL( "/\\" ) ); + dstring::size_type pos = m_program_name.find_last_of( BOOST_TEST_UTILS_RUNTIME_PARAM_LITERAL( "/\\" ) ); if( pos != static_cast<dstring::size_type>(cstring::npos) ) m_program_name.erase( 0, pos+1 ); @@ -108,18 +108,18 @@ parser::parse( int& argc, char_type** argv ) m_traverser.init( argc, argv ); - try { + BOOST_TEST_IMPL_TRY { while( !m_traverser.eoi() ) { parameter_ptr found_param; - BOOST_RT_PARAM_TRACE( "Total " << m_parameters.size() << " parameters registered" ); + BOOST_TEST_UTILS_RUNTIME_PARAM_TRACE( "Total " << m_parameters.size() << " parameters registered" ); BOOST_TEST_FOREACH( parameter_ptr const&, curr_param, m_parameters ) { - BOOST_RT_PARAM_TRACE( "Try parameter " << curr_param->id_2_report() ); + BOOST_TEST_UTILS_RUNTIME_PARAM_TRACE( "Try parameter " << curr_param->id_2_report() ); if( curr_param->matching( m_traverser, !found_param ) ) { - BOOST_RT_PARAM_TRACE( "Match found" ); - BOOST_RT_CLA_VALIDATE_INPUT( !found_param, (m_traverser.rollback(),m_traverser), "Ambiguous input" ); + BOOST_TEST_UTILS_RUNTIME_PARAM_TRACE( "Match found" ); + BOOST_TEST_UTILS_RUNTIME_CLA_VALIDATE_INPUT( !found_param, (m_traverser.rollback(),m_traverser), "Ambiguous input" ); found_param = curr_param; } @@ -128,14 +128,14 @@ parser::parse( int& argc, char_type** argv ) } if( !found_param ) { - BOOST_RT_PARAM_TRACE( "No match found" ); - BOOST_RT_CLA_VALIDATE_INPUT( m_traverser.handle_mismatch(), m_traverser, - BOOST_RT_PARAM_LITERAL( "Unexpected input" ) ); + BOOST_TEST_UTILS_RUNTIME_PARAM_TRACE( "No match found" ); + BOOST_TEST_UTILS_RUNTIME_CLA_VALIDATE_INPUT( m_traverser.handle_mismatch(), m_traverser, + BOOST_TEST_UTILS_RUNTIME_PARAM_LITERAL( "Unexpected input" ) ); continue; } - BOOST_RT_PARAM_TRACE( "Parse argument value" ); + BOOST_TEST_UTILS_RUNTIME_PARAM_TRACE( "Parse argument value" ); found_param->produce_argument( m_traverser ); m_traverser.commit(); @@ -145,31 +145,31 @@ parser::parse( int& argc, char_type** argv ) if( !curr_param->p_optional && !curr_param->actual_argument() ) { curr_param->produce_argument( *this ); - BOOST_RT_PARAM_VALIDATE_LOGIC( curr_param->actual_argument(), - BOOST_RT_PARAM_LITERAL( "Required argument for parameter " ) << curr_param->id_2_report() - << BOOST_RT_PARAM_LITERAL( " is missing" ) ); + BOOST_TEST_UTILS_RUNTIME_PARAM_VALIDATE_LOGIC( curr_param->actual_argument(), + BOOST_TEST_UTILS_RUNTIME_PARAM_LITERAL( "Required argument for parameter " ) << curr_param->id_2_report() + << BOOST_TEST_UTILS_RUNTIME_PARAM_LITERAL( " is missing" ) ); } } } - catch( bad_lexical_cast const& ) { - BOOST_RT_PARAM_REPORT_LOGIC_ERROR( - BOOST_RT_PARAM_LITERAL( "String to value convertion error during input parsing" ) ); - } + BOOST_TEST_IMPL_CATCH0( bad_lexical_cast ) { + BOOST_TEST_UTILS_RUNTIME_PARAM_REPORT_LOGIC_ERROR( + BOOST_TEST_UTILS_RUNTIME_PARAM_LITERAL( "String to value convertion error during input parsing" ) ); + }; m_traverser.remainder( argc, argv ); } //____________________________________________________________________________// -BOOST_RT_PARAM_INLINE const_argument_ptr +BOOST_TEST_UTILS_RUNTIME_PARAM_INLINE const_argument_ptr parser::operator[]( cstring string_id ) const { parameter_ptr found_param; BOOST_TEST_FOREACH( parameter_ptr const&, curr_param, m_parameters ) { if( curr_param->responds_to( string_id ) ) { - BOOST_RT_PARAM_VALIDATE_LOGIC( !found_param, - BOOST_RT_PARAM_LITERAL( "Ambiguous parameter string id: " ) << string_id ); + BOOST_TEST_UTILS_RUNTIME_PARAM_VALIDATE_LOGIC( !found_param, + BOOST_TEST_UTILS_RUNTIME_PARAM_LITERAL( "Ambiguous parameter string id: " ) << string_id ); found_param = curr_param; } @@ -180,7 +180,7 @@ parser::operator[]( cstring string_id ) const //____________________________________________________________________________// -BOOST_RT_PARAM_INLINE cstring +BOOST_TEST_UTILS_RUNTIME_PARAM_INLINE cstring parser::get( cstring string_id ) const { return get<cstring>( string_id ); @@ -188,46 +188,46 @@ parser::get( cstring string_id ) const //____________________________________________________________________________// -BOOST_RT_PARAM_INLINE void +BOOST_TEST_UTILS_RUNTIME_PARAM_INLINE void parser::usage( out_stream& ostr ) { if( m_program_name.empty() ) - assign_op( m_program_name, BOOST_RT_PARAM_CSTRING_LITERAL( "<program>" ), 0 ); + assign_op( m_program_name, BOOST_TEST_UTILS_RUNTIME_PARAM_CSTRING_LITERAL( "<program>" ), 0 ); format_stream fs; fs << m_program_name; BOOST_TEST_FOREACH( parameter_ptr const&, curr_param, m_parameters ) { - fs << BOOST_RT_PARAM_LITERAL( ' ' ); + fs << BOOST_TEST_UTILS_RUNTIME_PARAM_LITERAL( ' ' ); if( curr_param->p_optional ) - fs << BOOST_RT_PARAM_LITERAL( '[' ); + fs << BOOST_TEST_UTILS_RUNTIME_PARAM_LITERAL( '[' ); curr_param->usage_info( fs ); if( curr_param->p_optional ) - fs << BOOST_RT_PARAM_LITERAL( ']' ); + fs << BOOST_TEST_UTILS_RUNTIME_PARAM_LITERAL( ']' ); if( curr_param->p_multiplicable ) { - fs << BOOST_RT_PARAM_CSTRING_LITERAL( " ... " ); - + fs << BOOST_TEST_UTILS_RUNTIME_PARAM_CSTRING_LITERAL( " ... " ); + if( curr_param->p_optional ) - fs << BOOST_RT_PARAM_LITERAL( '[' ); + fs << BOOST_TEST_UTILS_RUNTIME_PARAM_LITERAL( '[' ); curr_param->usage_info( fs ); if( curr_param->p_optional ) - fs << BOOST_RT_PARAM_LITERAL( ']' ); + fs << BOOST_TEST_UTILS_RUNTIME_PARAM_LITERAL( ']' ); } } - ostr << BOOST_RT_PARAM_CSTRING_LITERAL( "Usage:\n" ) << fs.str() << std::endl; + ostr << BOOST_TEST_UTILS_RUNTIME_PARAM_CSTRING_LITERAL( "Usage:\n" ) << fs.str() << std::endl; } //____________________________________________________________________________// -BOOST_RT_PARAM_INLINE void +BOOST_TEST_UTILS_RUNTIME_PARAM_INLINE void parser::help( out_stream& ostr ) { usage( ostr ); @@ -239,20 +239,29 @@ parser::help( out_stream& ostr ) continue; if( need_where ) { - ostr << BOOST_RT_PARAM_CSTRING_LITERAL( "where:\n" ); + ostr << BOOST_TEST_UTILS_RUNTIME_PARAM_CSTRING_LITERAL( "where:\n" ); need_where = false; } - ostr << curr_param->id_2_report() << BOOST_RT_PARAM_CSTRING_LITERAL( " - " ) << curr_param->p_description << std::endl; + ostr << curr_param->id_2_report() << BOOST_TEST_UTILS_RUNTIME_PARAM_CSTRING_LITERAL( " - " ) << curr_param->p_description << std::endl; } } //____________________________________________________________________________// +BOOST_TEST_UTILS_RUNTIME_PARAM_INLINE void +parser::reset() +{ + BOOST_TEST_FOREACH( parameter_ptr const&, param, m_parameters ) + param->reset(); +} + +//____________________________________________________________________________// + } // namespace cla -} // namespace BOOST_RT_PARAM_NAMESPACE +} // namespace BOOST_TEST_UTILS_RUNTIME_PARAM_NAMESPACE } // namespace boost -#endif // BOOST_RT_CLA_PARSER_IPP_062904GER +#endif // BOOST_TEST_UTILS_RUNTIME_CLA_PARSER_IPP diff --git a/boost/test/utils/runtime/cla/positional_parameter.hpp b/boost/test/utils/runtime/cla/positional_parameter.hpp index 60da845627..f378743dd5 100644 --- a/boost/test/utils/runtime/cla/positional_parameter.hpp +++ b/boost/test/utils/runtime/cla/positional_parameter.hpp @@ -1,6 +1,6 @@ -// (C) Copyright Gennadiy Rozental 2005-2008. -// Use, modification, and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file +// (C) Copyright Gennadiy Rozental 2005-2014. +// Use, modification, and distribution are subject to 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) // See http://www.boost.org/libs/test for the library home page. @@ -12,8 +12,8 @@ // Description : positional parameter model // *************************************************************************** -#ifndef BOOST_RT_CLA_POSITIONAL_PARAMETER_HPP_062604GER -#define BOOST_RT_CLA_POSITIONAL_PARAMETER_HPP_062604GER +#ifndef BOOST_TEST_UTILS_RUNTIME_CLA_POSITIONAL_PARAMETER_HPP +#define BOOST_TEST_UTILS_RUNTIME_CLA_POSITIONAL_PARAMETER_HPP // Boost.Runtime.Parameter #include <boost/test/utils/runtime/config.hpp> @@ -22,7 +22,7 @@ namespace boost { -namespace BOOST_RT_PARAM_NAMESPACE { +namespace BOOST_TEST_UTILS_RUNTIME_PARAM_NAMESPACE { namespace cla { @@ -35,17 +35,17 @@ public: trivial_id_policy() : identification_policy( rtti::type_id<trivial_id_policy>() ) {} - BOOST_RT_PARAM_UNNEEDED_VIRTUAL ~trivial_id_policy() {} + BOOST_TEST_UTILS_RUNTIME_PARAM_UNNEEDED_VIRTUAL ~trivial_id_policy() {} virtual bool responds_to( cstring name ) const { return m_name == name; } virtual bool conflict_with( identification_policy const& ) const { return false; } virtual cstring id_2_report() const { return m_name; } virtual void usage_info( format_stream& fs ) const - { + { if( !m_name.empty() ) - fs << BOOST_RT_PARAM_LITERAL( '<' ) << m_name << BOOST_RT_PARAM_LITERAL( '>' ); + fs << BOOST_TEST_UTILS_RUNTIME_PARAM_LITERAL( '<' ) << m_name << BOOST_TEST_UTILS_RUNTIME_PARAM_LITERAL( '>' ); else - fs << BOOST_RT_PARAM_CSTRING_LITERAL( "<value>" ); + fs << BOOST_TEST_UTILS_RUNTIME_PARAM_CSTRING_LITERAL( "<value>" ); } virtual bool matching( parameter const& p, argv_traverser&, bool primary ) const @@ -80,12 +80,12 @@ public: //____________________________________________________________________________// -BOOST_RT_CLA_NAMED_PARAM_GENERATORS( positional_parameter ) +BOOST_TEST_UTILS_RUNTIME_CLA_NAMED_PARAM_GENERATORS( positional_parameter ) } // namespace cla -} // namespace BOOST_RT_PARAM_NAMESPACE +} // namespace BOOST_TEST_UTILS_RUNTIME_PARAM_NAMESPACE } // namespace boost -#endif // BOOST_RT_CLA_POSITIONAL_PARAMETER_HPP_062604GER +#endif // BOOST_TEST_UTILS_RUNTIME_CLA_POSITIONAL_PARAMETER_HPP diff --git a/boost/test/utils/runtime/cla/typed_parameter.hpp b/boost/test/utils/runtime/cla/typed_parameter.hpp index 3d4c57b23a..70c5bbc009 100644 --- a/boost/test/utils/runtime/cla/typed_parameter.hpp +++ b/boost/test/utils/runtime/cla/typed_parameter.hpp @@ -1,6 +1,6 @@ -// (C) Copyright Gennadiy Rozental 2005-2008. -// Use, modification, and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file +// (C) Copyright Gennadiy Rozental 2005-2014. +// Use, modification, and distribution are subject to 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) // See http://www.boost.org/libs/test for the library home page. @@ -12,8 +12,8 @@ // Description : generic typed parameter model // *************************************************************************** -#ifndef BOOST_RT_CLA_TYPED_PARAMETER_HPP_062604GER -#define BOOST_RT_CLA_TYPED_PARAMETER_HPP_062604GER +#ifndef BOOST_TEST_UTILS_RUNTIME_CLA_TYPED_PARAMETER_HPP +#define BOOST_TEST_UTILS_RUNTIME_CLA_TYPED_PARAMETER_HPP // Boost.Runtime.Parameter #include <boost/test/utils/runtime/config.hpp> @@ -29,7 +29,7 @@ namespace boost { -namespace BOOST_RT_PARAM_NAMESPACE { +namespace BOOST_TEST_UTILS_RUNTIME_PARAM_NAMESPACE { namespace cla { @@ -40,8 +40,8 @@ namespace cla { template<typename T> class typed_parameter : public cla::parameter { public: - explicit typed_parameter( identification_policy& ID ) - : cla::parameter( ID, m_arg_factory, rtti::type_id<T>() == rtti::type_id<bool>() ) + explicit typed_parameter( identification_policy& ID ) + : cla::parameter( ID, m_arg_factory, rtti::type_id<T>() == rtti::type_id<bool>() ) {} // parameter properties modification @@ -52,8 +52,8 @@ public: m_arg_factory.accept_modifier( m ); - BOOST_RT_PARAM_VALIDATE_LOGIC( !p_optional || !m_arg_factory.m_value_generator, - BOOST_RT_PARAM_LITERAL( "can't define a value generator for optional parameter " ) << id_2_report() ); + BOOST_TEST_UTILS_RUNTIME_PARAM_VALIDATE_LOGIC( !p_optional || !m_arg_factory.m_value_generator, + BOOST_TEST_UTILS_RUNTIME_PARAM_LITERAL( "can't define a value generator for optional parameter " ) << id_2_report() ); } private: @@ -63,8 +63,8 @@ private: } // namespace cla -} // namespace BOOST_RT_PARAM_NAMESPACE +} // namespace BOOST_TEST_UTILS_RUNTIME_PARAM_NAMESPACE } // namespace boost -#endif // BOOST_RT_CLA_TYPED_PARAMETER_HPP_062604GER +#endif // BOOST_TEST_UTILS_RUNTIME_CLA_TYPED_PARAMETER_HPP diff --git a/boost/test/utils/runtime/cla/validation.cpp b/boost/test/utils/runtime/cla/validation.cpp index f5c1e6669a..7f19a5ca45 100644 --- a/boost/test/utils/runtime/cla/validation.cpp +++ b/boost/test/utils/runtime/cla/validation.cpp @@ -1,6 +1,6 @@ -// (C) Copyright Gennadiy Rozental 2005-2008. -// Use, modification, and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file +// (C) Copyright Gennadiy Rozental 2005-2014. +// Use, modification, and distribution are subject to 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) // See http://www.boost.org/libs/test for the library home page. @@ -12,5 +12,5 @@ // Description : input validation helpers offline implementation // *************************************************************************** -#define BOOST_RT_PARAM_INLINE +#define BOOST_TEST_UTILS_RUNTIME_PARAM_INLINE #include <boost/test/utils/runtime/cla/validation.ipp> diff --git a/boost/test/utils/runtime/cla/validation.hpp b/boost/test/utils/runtime/cla/validation.hpp index 57a7f2459f..8a3da14c5b 100644 --- a/boost/test/utils/runtime/cla/validation.hpp +++ b/boost/test/utils/runtime/cla/validation.hpp @@ -1,6 +1,6 @@ -// (C) Copyright Gennadiy Rozental 2005-2008. -// Use, modification, and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file +// (C) Copyright Gennadiy Rozental 2005-2014. +// Use, modification, and distribution are subject to 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) // See http://www.boost.org/libs/test for the library home page. @@ -12,8 +12,8 @@ // Description : input validation helpers definition // *************************************************************************** -#ifndef BOOST_RT_CLA_VALIDATION_HPP_062604GER -#define BOOST_RT_CLA_VALIDATION_HPP_062604GER +#ifndef BOOST_TEST_UTILS_RUNTIME_CLA_VALIDATION_HPP +#define BOOST_TEST_UTILS_RUNTIME_CLA_VALIDATION_HPP // Boost.Runtime.Parameter #include <boost/test/utils/runtime/config.hpp> @@ -22,7 +22,7 @@ namespace boost { -namespace BOOST_RT_PARAM_NAMESPACE { +namespace BOOST_TEST_UTILS_RUNTIME_PARAM_NAMESPACE { namespace cla { @@ -34,22 +34,24 @@ void report_input_error( argv_traverser const& tr, format_stream& msg ); //____________________________________________________________________________// -#define BOOST_RT_CLA_VALIDATE_INPUT( b, tr, msg ) \ - if( b ) ; else ::boost::BOOST_RT_PARAM_NAMESPACE::cla::report_input_error( tr, format_stream().ref() << msg ) +#define BOOST_TEST_UTILS_RUNTIME_CLA_VALIDATE_INPUT( b, tr, msg ) \ + if( b ) ; else ::boost::BOOST_TEST_UTILS_RUNTIME_PARAM_NAMESPACE::cla::report_input_error( tr, format_stream().ref() << msg ) //____________________________________________________________________________// } // namespace cla -} // namespace BOOST_RT_PARAM_NAMESPACE +} // namespace BOOST_TEST_UTILS_RUNTIME_PARAM_NAMESPACE } // namespace boost -#ifndef BOOST_RT_PARAM_OFFLINE +#ifndef BOOST_TEST_UTILS_RUNTIME_PARAM_OFFLINE -# define BOOST_RT_PARAM_INLINE inline -# include <boost/test/utils/runtime/cla/validation.ipp> +#ifndef BOOST_TEST_UTILS_RUNTIME_PARAM_INLINE +# define BOOST_TEST_UTILS_RUNTIME_PARAM_INLINE inline +#endif +# include <boost/test/utils/runtime/cla/validation.ipp> #endif -#endif // BOOST_RT_CLA_VALIDATION_HPP_062604GER +#endif // BOOST_TEST_UTILS_RUNTIME_CLA_VALIDATION_HPP diff --git a/boost/test/utils/runtime/cla/validation.ipp b/boost/test/utils/runtime/cla/validation.ipp index 9728bd6702..9d8cd27b4a 100644 --- a/boost/test/utils/runtime/cla/validation.ipp +++ b/boost/test/utils/runtime/cla/validation.ipp @@ -1,35 +1,31 @@ -// (C) Copyright Gennadiy Rozental 2005-2008. -// Use, modification, and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file +// (C) Copyright Gennadiy Rozental 2005-2014. +// Use, modification, and distribution are subject to 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) // See http://www.boost.org/libs/test for the library home page. // -// File : $RCSfile$ -// -// Version : $Revision$ -// -// Description : input validation helpers implementation +//! @file +//! @brief Input validation helpers implementation // *************************************************************************** -#ifndef BOOST_RT_CLA_VALIDATION_IPP_070604GER -#define BOOST_RT_CLA_VALIDATION_IPP_070604GER +#ifndef BOOST_TEST_UTILS_RUNTIME_CLA_VALIDATION_IPP +#define BOOST_TEST_UTILS_RUNTIME_CLA_VALIDATION_IPP // Boost.Runtime.Parameter #include <boost/test/utils/runtime/config.hpp> #include <boost/test/utils/runtime/cla/argv_traverser.hpp> #include <boost/test/utils/runtime/cla/validation.hpp> -#include <boost/test/utils/runtime/validation.hpp> // BOOST_RT_PARAM_NAMESPACE::logic_error +#include <boost/test/utils/runtime/validation.hpp> // BOOST_TEST_UTILS_RUNTIME_PARAM_NAMESPACE::logic_error -// Boost +// Boost.Test #include <boost/test/utils/basic_cstring/io.hpp> - -// STL +#include <boost/test/detail/throw_exception.hpp> namespace boost { -namespace BOOST_RT_PARAM_NAMESPACE { +namespace BOOST_TEST_UTILS_RUNTIME_PARAM_NAMESPACE { namespace cla { @@ -37,29 +33,29 @@ namespace cla { // ************** runtime::cla::validation ************** // // ************************************************************************** // -BOOST_RT_PARAM_INLINE void +BOOST_TEST_UTILS_RUNTIME_PARAM_INLINE void report_input_error( argv_traverser const& tr, format_stream& msg ) { if( tr.eoi() ) - msg << BOOST_RT_PARAM_LITERAL( " at the end of input" ); + msg << BOOST_TEST_UTILS_RUNTIME_PARAM_LITERAL( " at the end of input" ); else { - msg << BOOST_RT_PARAM_LITERAL( " in the following position: " ); + msg << BOOST_TEST_UTILS_RUNTIME_PARAM_LITERAL( " in the following position: " ); if( tr.input().size() > 5 ) - msg << tr.input().substr( 0, 5 ) << BOOST_RT_PARAM_LITERAL( "..." ); + msg << tr.input().substr( 0, 5 ) << BOOST_TEST_UTILS_RUNTIME_PARAM_LITERAL( "..." ); else msg << tr.input(); } - throw BOOST_RT_PARAM_NAMESPACE::logic_error( msg.str() ); + BOOST_TEST_IMPL_THROW( BOOST_TEST_UTILS_RUNTIME_PARAM_NAMESPACE::logic_error( msg.str() ) ); } //____________________________________________________________________________// } // namespace cla -} // namespace BOOST_RT_PARAM_NAMESPACE +} // namespace BOOST_TEST_UTILS_RUNTIME_PARAM_NAMESPACE } // namespace boost -#endif // BOOST_RT_CLA_VALIDATION_IPP_070604GER +#endif // BOOST_TEST_UTILS_RUNTIME_CLA_VALIDATION_IPP diff --git a/boost/test/utils/runtime/cla/value_generator.hpp b/boost/test/utils/runtime/cla/value_generator.hpp index ab15c9b551..0efc25def1 100644 --- a/boost/test/utils/runtime/cla/value_generator.hpp +++ b/boost/test/utils/runtime/cla/value_generator.hpp @@ -1,6 +1,6 @@ -// (C) Copyright Gennadiy Rozental 2005-2008. -// Use, modification, and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file +// (C) Copyright Gennadiy Rozental 2005-2014. +// Use, modification, and distribution are subject to 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) // See http://www.boost.org/libs/test for the library home page. @@ -12,8 +12,8 @@ // Description : specific value generators // *************************************************************************** -#ifndef BOOST_RT_CLA_VALUE_GENERATOR_HPP_062604GER -#define BOOST_RT_CLA_VALUE_GENERATOR_HPP_062604GER +#ifndef BOOST_TEST_UTILS_RUNTIME_CLA_VALUE_GENERATOR_HPP +#define BOOST_TEST_UTILS_RUNTIME_CLA_VALUE_GENERATOR_HPP // Boost.Runtime.Parameter #include <boost/test/utils/runtime/config.hpp> @@ -23,7 +23,7 @@ namespace boost { -namespace BOOST_RT_PARAM_NAMESPACE { +namespace BOOST_TEST_UTILS_RUNTIME_PARAM_NAMESPACE { namespace cla { @@ -74,8 +74,8 @@ private: } // namespace cla -} // namespace BOOST_RT_PARAM_NAMESPACE +} // namespace BOOST_TEST_UTILS_RUNTIME_PARAM_NAMESPACE } // namespace boost -#endif // BOOST_RT_CLA_VALUE_GENERATOR_HPP_062604GER +#endif // BOOST_TEST_UTILS_RUNTIME_CLA_VALUE_GENERATOR_HPP diff --git a/boost/test/utils/runtime/cla/value_handler.hpp b/boost/test/utils/runtime/cla/value_handler.hpp index fbf99667aa..38792602ac 100644 --- a/boost/test/utils/runtime/cla/value_handler.hpp +++ b/boost/test/utils/runtime/cla/value_handler.hpp @@ -1,6 +1,6 @@ -// (C) Copyright Gennadiy Rozental 2005-2008. -// Use, modification, and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file +// (C) Copyright Gennadiy Rozental 2005-2014. +// Use, modification, and distribution are subject to 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) // See http://www.boost.org/libs/test for the library home page. @@ -12,8 +12,8 @@ // Description : specific value handlers // *************************************************************************** -#ifndef BOOST_RT_CLA_VALUE_HANDLER_HPP_062604GER -#define BOOST_RT_CLA_VALUE_HANDLER_HPP_062604GER +#ifndef BOOST_TEST_UTILS_RUNTIME_CLA_VALUE_HANDLER_HPP +#define BOOST_TEST_UTILS_RUNTIME_CLA_VALUE_HANDLER_HPP // Boost.Runtime.Parameter #include <boost/test/utils/runtime/config.hpp> @@ -22,7 +22,7 @@ namespace boost { -namespace BOOST_RT_PARAM_NAMESPACE { +namespace BOOST_TEST_UTILS_RUNTIME_PARAM_NAMESPACE { namespace cla { @@ -50,8 +50,8 @@ private: } // namespace cla -} // namespace BOOST_RT_PARAM_NAMESPACE +} // namespace BOOST_TEST_UTILS_RUNTIME_PARAM_NAMESPACE } // namespace boost -#endif // BOOST_RT_CLA_VALUE_HANDLER_HPP_062604GER +#endif // BOOST_TEST_UTILS_RUNTIME_CLA_VALUE_HANDLER_HPP |