Moved some components into a detail sub-directory

git-svn-id: https://svn.code.sf.net/p/turtle/code/trunk@478 860be788-9bd5-4423-9f1e-828f051e677b
This commit is contained in:
mat007 2012-07-22 06:51:19 +00:00
parent dc2d66245f
commit 4a128a0221
28 changed files with 188 additions and 145 deletions

View file

@ -9,7 +9,7 @@
#ifndef MOCK_ACTION_HPP_INCLUDED
#define MOCK_ACTION_HPP_INCLUDED
#include "lambda.hpp"
#include "detail/lambda.hpp"
#include <boost/type_traits/remove_reference.hpp>
#include <boost/type_traits/remove_const.hpp>
#include <boost/shared_ptr.hpp>

View file

@ -13,7 +13,7 @@
#ifdef MOCK_USE_BOOST_TEST
#include "root.hpp"
#include "detail/root.hpp"
#include <boost/test/unit_test_suite.hpp>
namespace mock

View file

@ -9,8 +9,8 @@
#ifndef MOCK_CHILD_HPP_INCLUDED
#define MOCK_CHILD_HPP_INCLUDED
#include "parent.hpp"
#include "type_name.hpp"
#include "detail/type_name.hpp"
#include "detail/parent.hpp"
#include <boost/test/utils/basic_cstring/basic_cstring.hpp>
#include <boost/optional.hpp>
#include <ostream>

View file

@ -9,7 +9,7 @@
#ifndef MOCK_CONTEXT_HPP_INCLUDED
#define MOCK_CONTEXT_HPP_INCLUDED
#include "type_name.hpp"
#include "detail/type_name.hpp"
#include <boost/noncopyable.hpp>
#include <boost/optional.hpp>
#include <boost/test/utils/basic_cstring/basic_cstring.hpp>

View file

@ -9,7 +9,7 @@
#ifndef MOCK_GROUP_HPP_INCLUDED
#define MOCK_GROUP_HPP_INCLUDED
#include "verifiable.hpp"
#include "detail/verifiable.hpp"
#include <functional>
#include <algorithm>
#include <vector>

View file

@ -9,7 +9,7 @@
#ifndef MOCK_LAMBDA_HPP_INCLUDED
#define MOCK_LAMBDA_HPP_INCLUDED
#include "config.hpp"
#include "../config.hpp"
#ifdef MOCK_USE_BOOST_PHOENIX
#include <boost/spirit/home/phoenix/bind.hpp>
#else

View file

@ -9,7 +9,7 @@
#ifndef MOCK_PARENT_HPP_INCLUDED
#define MOCK_PARENT_HPP_INCLUDED
#include "type_name.hpp"
#include "detail/type_name.hpp"
#include <boost/optional.hpp>
#include <boost/test/utils/basic_cstring/io.hpp>
#include <ostream>

View file

@ -9,11 +9,10 @@
#ifndef MOCK_ROOT_HPP_INCLUDED
#define MOCK_ROOT_HPP_INCLUDED
#include "group.hpp"
#include "context.hpp"
#include "parent.hpp"
#include "child.hpp"
#include "function.hpp"
#include "detail/parent.hpp"
#include "detail/group.hpp"
#include "detail/context.hpp"
#include "detail/child.hpp"
#include <boost/test/utils/trivial_singleton.hpp>
#include <ostream>
#include <map>

View file

@ -0,0 +1,62 @@
// http://turtle.sourceforge.net
//
// Copyright Mathieu Champlon 2012
//
// 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)
#ifndef MOCK_SIGNATURE_HPP_INCLUDED
#define MOCK_SIGNATURE_HPP_INCLUDED
#include <boost/function_types/parameter_types.hpp>
#include <boost/function_types/function_type.hpp>
#include <boost/function_types/result_type.hpp>
#include <boost/mpl/single_view.hpp>
#include <boost/mpl/joint_view.hpp>
#include <boost/mpl/pop_front.hpp>
#define BOOST_TYPEOF_SILENT
#include <boost/typeof/typeof.hpp>
namespace mock
{
namespace detail
{
template< typename M >
struct signature :
boost::function_types::function_type<
boost::mpl::joint_view<
boost::mpl::single_view<
BOOST_DEDUCED_TYPENAME
boost::function_types::result_type< M >::type
>,
BOOST_DEDUCED_TYPENAME boost::mpl::pop_front<
BOOST_DEDUCED_TYPENAME
boost::function_types::parameter_types< M >
>::type
>
>
{};
template< typename T >
struct base
{
typedef T base_type;
};
}
// if an error is generated by the line below it means
// the method is ambiguous : use MOCK_METHOD_EXT instead
template< typename T >
T& ambiguous_method_name_use_MOCK_METHOD_EXT_instead( const T& );
} // mock
#define MOCK_SIGNATURE(M) \
mock::detail::signature< \
BOOST_TYPEOF( \
mock::ambiguous_method_name_use_MOCK_METHOD_EXT_instead( \
&base_type::M ) ) \
>::type
#endif // MOCK_SIGNATURE_HPP_INCLUDED

View file

@ -11,12 +11,12 @@
#include "config.hpp"
#include "error.hpp"
#include "context.hpp"
#include "expectation.hpp"
#include "verifiable.hpp"
#include "log.hpp"
#include "args.hpp"
#include "type_name.hpp"
#include "detail/verifiable.hpp"
#include "detail/type_name.hpp"
#include "detail/context.hpp"
#include "detail/args.hpp"
#include <boost/function_types/result_type.hpp>
#include <boost/function_types/function_arity.hpp>
#include <boost/function_types/parameter_types.hpp>

View file

@ -9,7 +9,7 @@
#ifndef MOCK_IS_FUNCTOR_HPP_INCLUDED
#define MOCK_IS_FUNCTOR_HPP_INCLUDED
#include "yes_no_type.hpp"
#include "detail/yes_no_type.hpp"
#include <boost/function_types/is_callable_builtin.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/mpl/or.hpp>

View file

@ -13,46 +13,16 @@
#include "cleanup.hpp"
#include "object.hpp"
#include "function.hpp"
#include "args.hpp"
#include "type_name.hpp"
#include "detail/type_name.hpp"
#include "detail/args.hpp"
#include "detail/signature.hpp"
#include <boost/preprocessor/repetition/repeat.hpp>
#include <boost/preprocessor/stringize.hpp>
#include <boost/function_types/parameter_types.hpp>
#include <boost/function_types/function_type.hpp>
#include <boost/function_types/result_type.hpp>
#include <boost/mpl/joint_view.hpp>
#include <boost/mpl/single_view.hpp>
#include <boost/mpl/pop_front.hpp>
#define BOOST_TYPEOF_SILENT
#include <boost/typeof/typeof.hpp>
#include <boost/type_traits.hpp>
namespace mock
{
namespace detail
{
template< typename M >
struct signature :
boost::function_types::function_type<
boost::mpl::joint_view<
boost::mpl::single_view<
BOOST_DEDUCED_TYPENAME
boost::function_types::result_type< M >::type
>,
BOOST_DEDUCED_TYPENAME boost::mpl::pop_front<
BOOST_DEDUCED_TYPENAME
boost::function_types::parameter_types< M >
>::type
>
>
{};
template< typename T >
struct base
{
typedef T base_type;
};
template< typename S >
struct functor : mock::function< S >
{
@ -69,11 +39,6 @@ namespace detail
}
};
}
// if an error is generated by the line below it means
// the method is ambiguous : use MOCK_METHOD_EXT instead
template< typename T >
T& ambiguous_method_name_use_MOCK_METHOD_EXT_instead( const T& );
} // mock
#define MOCK_BASE_CLASS(T, I) \
@ -101,13 +66,6 @@ namespace detail
return t##_mock_; \
}
#define MOCK_SIGNATURE(M) \
mock::detail::signature< \
BOOST_TYPEOF( \
mock::ambiguous_method_name_use_MOCK_METHOD_EXT_instead( \
&base_type::M ) ) \
>::type
#define MOCK_METHOD_AUX(M, n, S, t, c, tpn) \
MOCK_DECL(M, n, S, c, tpn) \
{ \

View file

@ -9,11 +9,11 @@
#ifndef MOCK_OBJECT_HPP_INCLUDED
#define MOCK_OBJECT_HPP_INCLUDED
#include "root.hpp"
#include "context.hpp"
#include "parent.hpp"
#include "child.hpp"
#include "type_name.hpp"
#include "detail/root.hpp"
#include "detail/parent.hpp"
#include "detail/type_name.hpp"
#include "detail/context.hpp"
#include "detail/child.hpp"
#include <boost/test/utils/basic_cstring/basic_cstring.hpp>
#include <boost/enable_shared_from_this.hpp>
#include <boost/type_traits/is_base_of.hpp>