mirror of
https://github.com/mat007/turtle.git
synced 2026-06-22 12:13:43 +00:00
Use default/delete for ctor/dtor
This commit is contained in:
parent
35fa6e63e6
commit
353849e9ad
28 changed files with 100 additions and 92 deletions
|
|
@ -17,8 +17,7 @@ namespace
|
||||||
class base
|
class base
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual ~base()
|
virtual ~base() = default;
|
||||||
{}
|
|
||||||
|
|
||||||
virtual void method() = 0;
|
virtual void method() = 0;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -15,8 +15,7 @@ namespace
|
||||||
//[ limitations_throw_specifier_problem
|
//[ limitations_throw_specifier_problem
|
||||||
struct base_class
|
struct base_class
|
||||||
{
|
{
|
||||||
virtual ~base_class()
|
virtual ~base_class() = default;
|
||||||
{}
|
|
||||||
|
|
||||||
virtual void method() throw ();
|
virtual void method() throw ();
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -121,8 +121,7 @@ namespace member_function_example_1
|
||||||
//[ member_function_example_1
|
//[ member_function_example_1
|
||||||
struct base_class
|
struct base_class
|
||||||
{
|
{
|
||||||
virtual ~base_class()
|
virtual ~base_class() = default;
|
||||||
{}
|
|
||||||
virtual void method( int ) = 0;
|
virtual void method( int ) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -138,8 +137,7 @@ namespace member_function_example_2
|
||||||
//[ member_function_example_2
|
//[ member_function_example_2
|
||||||
struct base_class
|
struct base_class
|
||||||
{
|
{
|
||||||
virtual ~base_class()
|
virtual ~base_class() = default;
|
||||||
{}
|
|
||||||
virtual void method( int, const std::string& ) = 0;
|
virtual void method( int, const std::string& ) = 0;
|
||||||
virtual void method( float ) = 0;
|
virtual void method( float ) = 0;
|
||||||
};
|
};
|
||||||
|
|
@ -157,8 +155,7 @@ namespace member_function_example_3
|
||||||
//[ member_function_example_3
|
//[ member_function_example_3
|
||||||
struct base_class
|
struct base_class
|
||||||
{
|
{
|
||||||
virtual ~base_class()
|
virtual ~base_class() = default;
|
||||||
{}
|
|
||||||
virtual void method( float ) = 0;
|
virtual void method( float ) = 0;
|
||||||
virtual void method( float ) const = 0;
|
virtual void method( float ) const = 0;
|
||||||
};
|
};
|
||||||
|
|
@ -175,8 +172,7 @@ namespace member_function_example_4
|
||||||
//[ member_function_example_4
|
//[ member_function_example_4
|
||||||
struct base_class
|
struct base_class
|
||||||
{
|
{
|
||||||
virtual ~base_class()
|
virtual ~base_class() = default;
|
||||||
{}
|
|
||||||
virtual void method( float ) = 0;
|
virtual void method( float ) = 0;
|
||||||
virtual void method( float ) const = 0;
|
virtual void method( float ) const = 0;
|
||||||
};
|
};
|
||||||
|
|
@ -194,8 +190,7 @@ namespace member_function_example_5
|
||||||
//[ member_function_example_5
|
//[ member_function_example_5
|
||||||
struct base_class
|
struct base_class
|
||||||
{
|
{
|
||||||
virtual ~base_class()
|
virtual ~base_class() = default;
|
||||||
{}
|
|
||||||
virtual void method( float ) = 0;
|
virtual void method( float ) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,8 +26,7 @@ namespace mock
|
||||||
template< typename Constraint >
|
template< typename Constraint >
|
||||||
struct constraint
|
struct constraint
|
||||||
{
|
{
|
||||||
constraint()
|
constraint() {}
|
||||||
{}
|
|
||||||
constraint( const Constraint& c )
|
constraint( const Constraint& c )
|
||||||
: c_( c )
|
: c_( c )
|
||||||
{}
|
{}
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,6 @@
|
||||||
#define MOCK_ACTION_HPP_INCLUDED
|
#define MOCK_ACTION_HPP_INCLUDED
|
||||||
|
|
||||||
#include "../config.hpp"
|
#include "../config.hpp"
|
||||||
#include <boost/noncopyable.hpp>
|
|
||||||
#include <boost/bind.hpp>
|
#include <boost/bind.hpp>
|
||||||
#include <boost/ref.hpp>
|
#include <boost/ref.hpp>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
|
@ -112,10 +111,12 @@ namespace detail
|
||||||
{
|
{
|
||||||
return std::move( t );
|
return std::move( t );
|
||||||
}
|
}
|
||||||
struct value : boost::noncopyable
|
struct value
|
||||||
{
|
{
|
||||||
virtual ~value()
|
value() = default;
|
||||||
{}
|
value(const value&) = delete;
|
||||||
|
value& operator=(const value&) = delete;
|
||||||
|
virtual ~value() = default;
|
||||||
};
|
};
|
||||||
template< typename T >
|
template< typename T >
|
||||||
struct value_imp : value
|
struct value_imp : value
|
||||||
|
|
@ -177,8 +178,7 @@ namespace detail
|
||||||
: public action_base< std::auto_ptr< Result >, Signature >
|
: public action_base< std::auto_ptr< Result >, Signature >
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
action()
|
action() = default;
|
||||||
{}
|
|
||||||
action( const action& rhs )
|
action( const action& rhs )
|
||||||
: v_( rhs.v_.release() )
|
: v_( rhs.v_.release() )
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,6 @@
|
||||||
|
|
||||||
#include "../config.hpp"
|
#include "../config.hpp"
|
||||||
#include "type_name.hpp"
|
#include "type_name.hpp"
|
||||||
#include <boost/noncopyable.hpp>
|
|
||||||
#include <boost/optional.hpp>
|
#include <boost/optional.hpp>
|
||||||
#include <boost/test/utils/basic_cstring/basic_cstring.hpp>
|
#include <boost/test/utils/basic_cstring/basic_cstring.hpp>
|
||||||
#include <ostream>
|
#include <ostream>
|
||||||
|
|
@ -22,11 +21,14 @@ namespace detail
|
||||||
{
|
{
|
||||||
class verifiable;
|
class verifiable;
|
||||||
|
|
||||||
class context : boost::noncopyable
|
class context
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
context() {}
|
context() = default;
|
||||||
virtual ~context() {}
|
context(const context&) = delete;
|
||||||
|
context& operator=(const context&) = delete;
|
||||||
|
|
||||||
|
virtual ~context() = default;
|
||||||
|
|
||||||
virtual void add( const void* p, verifiable& v,
|
virtual void add( const void* p, verifiable& v,
|
||||||
boost::unit_test::const_string instance,
|
boost::unit_test::const_string instance,
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,6 @@
|
||||||
#include <boost/test/utils/basic_cstring/basic_cstring.hpp>
|
#include <boost/test/utils/basic_cstring/basic_cstring.hpp>
|
||||||
#include <boost/test/utils/lazy_ostream.hpp>
|
#include <boost/test/utils/lazy_ostream.hpp>
|
||||||
#include <boost/call_traits.hpp>
|
#include <boost/call_traits.hpp>
|
||||||
#include <boost/noncopyable.hpp>
|
|
||||||
#include <boost/optional.hpp>
|
#include <boost/optional.hpp>
|
||||||
#include <ostream>
|
#include <ostream>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,6 @@
|
||||||
#define MOCK_INVOCATION_HPP_INCLUDED
|
#define MOCK_INVOCATION_HPP_INCLUDED
|
||||||
|
|
||||||
#include "../config.hpp"
|
#include "../config.hpp"
|
||||||
#include <boost/noncopyable.hpp>
|
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <ostream>
|
#include <ostream>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
|
|
@ -19,11 +18,14 @@ namespace mock
|
||||||
{
|
{
|
||||||
namespace detail
|
namespace detail
|
||||||
{
|
{
|
||||||
class invocation : private boost::noncopyable
|
class invocation
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
invocation() {}
|
invocation() = default;
|
||||||
virtual ~invocation() {}
|
invocation(const invocation&) = delete;
|
||||||
|
invocation& operator=(const invocation&) = delete;
|
||||||
|
|
||||||
|
virtual ~invocation() = default;
|
||||||
|
|
||||||
virtual bool invoke() = 0;
|
virtual bool invoke() = 0;
|
||||||
virtual bool verify() const = 0;
|
virtual bool verify() const = 0;
|
||||||
|
|
|
||||||
|
|
@ -18,10 +18,12 @@ namespace detail
|
||||||
template<
|
template<
|
||||||
BOOST_PP_ENUM_PARAMS(MOCK_NUM_ARGS, typename T) >
|
BOOST_PP_ENUM_PARAMS(MOCK_NUM_ARGS, typename T) >
|
||||||
class matcher_base< void( BOOST_PP_ENUM_PARAMS(MOCK_NUM_ARGS, T) ) >
|
class matcher_base< void( BOOST_PP_ENUM_PARAMS(MOCK_NUM_ARGS, T) ) >
|
||||||
: boost::noncopyable
|
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual ~matcher_base() {}
|
matcher_base() = default;
|
||||||
|
matcher_base(const matcher_base&) = delete;
|
||||||
|
matcher_base& operator=(const matcher_base&) = delete;
|
||||||
|
virtual ~matcher_base() = default;
|
||||||
|
|
||||||
virtual bool operator()(
|
virtual bool operator()(
|
||||||
BOOST_PP_ENUM(MOCK_NUM_ARGS, MOCK_REF_ARG, _) ) = 0;
|
BOOST_PP_ENUM(MOCK_NUM_ARGS, MOCK_REF_ARG, _) ) = 0;
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,6 @@
|
||||||
|
|
||||||
#include "../config.hpp"
|
#include "../config.hpp"
|
||||||
#include "singleton.hpp"
|
#include "singleton.hpp"
|
||||||
#include <boost/noncopyable.hpp>
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
#ifdef MOCK_THREAD_SAFE
|
#ifdef MOCK_THREAD_SAFE
|
||||||
|
|
@ -75,8 +74,12 @@ namespace mock
|
||||||
{
|
{
|
||||||
namespace detail
|
namespace detail
|
||||||
{
|
{
|
||||||
struct mutex : boost::noncopyable
|
struct mutex
|
||||||
{
|
{
|
||||||
|
mutex() = default;
|
||||||
|
mutex(const mutex&) = delete;
|
||||||
|
mutex& operator=(const mutex&) = delete;
|
||||||
|
|
||||||
void lock()
|
void lock()
|
||||||
{}
|
{}
|
||||||
void unlock()
|
void unlock()
|
||||||
|
|
@ -86,18 +89,17 @@ namespace detail
|
||||||
// Constructor + Destructor make it RAII classes for compilers and avoid unused variable warnings
|
// Constructor + Destructor make it RAII classes for compilers and avoid unused variable warnings
|
||||||
struct scoped_lock
|
struct scoped_lock
|
||||||
{
|
{
|
||||||
scoped_lock( mutex& )
|
scoped_lock(const scoped_lock&) = delete;
|
||||||
{}
|
scoped_lock& operator=(const scoped_lock&) = delete;
|
||||||
~scoped_lock()
|
|
||||||
{}
|
scoped_lock( mutex& ) {}
|
||||||
|
~scoped_lock() {}
|
||||||
};
|
};
|
||||||
class lock
|
class lock
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
lock( const std::shared_ptr< mutex >& )
|
lock( const std::shared_ptr< mutex >& ) {}
|
||||||
{}
|
~lock() {}
|
||||||
~lock()
|
|
||||||
{}
|
|
||||||
lock(const lock&) = delete;
|
lock(const lock&) = delete;
|
||||||
lock( lock&& ) = default;
|
lock( lock&& ) = default;
|
||||||
lock& operator=( const lock& ) = delete;
|
lock& operator=( const lock& ) = delete;
|
||||||
|
|
|
||||||
|
|
@ -22,8 +22,7 @@ namespace detail
|
||||||
class parent
|
class parent
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
parent()
|
parent() = default;
|
||||||
{}
|
|
||||||
parent( boost::unit_test::const_string instance,
|
parent( boost::unit_test::const_string instance,
|
||||||
boost::optional< type_name > type )
|
boost::optional< type_name > type )
|
||||||
: instance_( instance )
|
: instance_( instance )
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,6 @@
|
||||||
|
|
||||||
#include "../config.hpp"
|
#include "../config.hpp"
|
||||||
#include "mutex.hpp"
|
#include "mutex.hpp"
|
||||||
#include <boost/noncopyable.hpp>
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
@ -20,7 +19,7 @@ namespace mock
|
||||||
{
|
{
|
||||||
namespace detail
|
namespace detail
|
||||||
{
|
{
|
||||||
class sequence_impl : private boost::noncopyable
|
class sequence_impl
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
sequence_impl()
|
sequence_impl()
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ protected:
|
||||||
#define MOCK_SINGLETON_CONS( type ) \
|
#define MOCK_SINGLETON_CONS( type ) \
|
||||||
private: \
|
private: \
|
||||||
friend class mock::detail::singleton< type >; \
|
friend class mock::detail::singleton< type >; \
|
||||||
type() {}
|
type() = default
|
||||||
|
|
||||||
#define MOCK_SINGLETON_INST( inst ) \
|
#define MOCK_SINGLETON_INST( inst ) \
|
||||||
static BOOST_JOIN( inst, _t )& inst = BOOST_JOIN( inst, _t )::instance();
|
static BOOST_JOIN( inst, _t )& inst = BOOST_JOIN( inst, _t )::instance();
|
||||||
|
|
|
||||||
|
|
@ -10,17 +10,18 @@
|
||||||
#define MOCK_VERIFIABLE_HPP_INCLUDED
|
#define MOCK_VERIFIABLE_HPP_INCLUDED
|
||||||
|
|
||||||
#include "../config.hpp"
|
#include "../config.hpp"
|
||||||
#include <boost/noncopyable.hpp>
|
|
||||||
|
|
||||||
namespace mock
|
namespace mock
|
||||||
{
|
{
|
||||||
namespace detail
|
namespace detail
|
||||||
{
|
{
|
||||||
class verifiable : private boost::noncopyable
|
class verifiable
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
verifiable() {}
|
verifiable() = default;
|
||||||
virtual ~verifiable() {}
|
verifiable(const verifiable&) = delete;
|
||||||
|
verifiable& operator=(const verifiable&) = delete;
|
||||||
|
virtual ~verifiable() = default;
|
||||||
|
|
||||||
virtual bool verify() const = 0;
|
virtual bool verify() const = 0;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -48,8 +48,7 @@ namespace detail
|
||||||
: impl_( std::make_shared< detail::object_impl >() )
|
: impl_( std::make_shared< detail::object_impl >() )
|
||||||
{}
|
{}
|
||||||
protected:
|
protected:
|
||||||
~object()
|
~object() = default;
|
||||||
{}
|
|
||||||
public:
|
public:
|
||||||
std::shared_ptr< detail::object_impl > impl_;
|
std::shared_ptr< detail::object_impl > impl_;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,6 @@
|
||||||
#define MOCK_STREAM_HPP_INCLUDED
|
#define MOCK_STREAM_HPP_INCLUDED
|
||||||
|
|
||||||
#include "config.hpp"
|
#include "config.hpp"
|
||||||
#include <boost/noncopyable.hpp>
|
|
||||||
#include <ostream>
|
#include <ostream>
|
||||||
|
|
||||||
namespace mock
|
namespace mock
|
||||||
|
|
@ -41,10 +40,13 @@ namespace conversion
|
||||||
return s << '?';
|
return s << '?';
|
||||||
}
|
}
|
||||||
|
|
||||||
struct holder : boost::noncopyable
|
struct holder
|
||||||
{
|
{
|
||||||
virtual ~holder()
|
holder() = default;
|
||||||
{}
|
holder(const holder&) = delete;
|
||||||
|
holder& operator=(const holder&) = delete;
|
||||||
|
|
||||||
|
virtual ~holder() = default;
|
||||||
virtual void serialize( std::ostream& s ) const = 0;
|
virtual void serialize( std::ostream& s ) const = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -64,12 +66,14 @@ namespace conversion
|
||||||
const T& t_;
|
const T& t_;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct any : boost::noncopyable
|
struct any
|
||||||
{
|
{
|
||||||
template< typename T >
|
template< typename T >
|
||||||
any( const T& t )
|
any( const T& t )
|
||||||
: h_( new holder_imp< T >( t ) )
|
: h_( new holder_imp< T >( t ) )
|
||||||
{}
|
{}
|
||||||
|
any(const any&) = delete;
|
||||||
|
any& operator=(const any&) = delete;
|
||||||
~any()
|
~any()
|
||||||
{
|
{
|
||||||
delete h_;
|
delete h_;
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ namespace
|
||||||
class base_class
|
class base_class
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual ~base_class() {}
|
virtual ~base_class() = default;
|
||||||
virtual void f1( int, int, int, int, int, int, int, int, int, int,
|
virtual void f1( int, int, int, int, int, int, int, int, int, int,
|
||||||
int, int, int, int, int, int, int, int, int, int,
|
int, int, int, int, int, int, int, int, int, int,
|
||||||
int, int, int, int, int, int, int, int, int, int ) = 0;
|
int, int, int, int, int, int, int, int, int, int ) = 0;
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ namespace
|
||||||
class base_class
|
class base_class
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual ~base_class() {}
|
virtual ~base_class() = default;
|
||||||
virtual void f1( int, int, int, int, int, int, int, int, int ) = 0;
|
virtual void f1( int, int, int, int, int, int, int, int, int ) = 0;
|
||||||
virtual void f2( int, int, int, int, int, int, int, int, int ) = 0;
|
virtual void f2( int, int, int, int, int, int, int, int, int ) = 0;
|
||||||
virtual void f3( int, int, int, int, int, int, int, int, int ) = 0;
|
virtual void f3( int, int, int, int, int, int, int, int, int ) = 0;
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ namespace
|
||||||
class base_class
|
class base_class
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual ~base_class() {}
|
virtual ~base_class() = default;
|
||||||
virtual void f1( int, int, int, int, int, int, int, int, int ) = 0;
|
virtual void f1( int, int, int, int, int, int, int, int, int ) = 0;
|
||||||
virtual void f2( int, int, int, int, int, int, int, int, int ) = 0;
|
virtual void f2( int, int, int, int, int, int, int, int, int ) = 0;
|
||||||
virtual void f3( int, int, int, int, int, int, int, int, int ) = 0;
|
virtual void f3( int, int, int, int, int, int, int, int, int ) = 0;
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ namespace
|
||||||
class base_class
|
class base_class
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual ~base_class() {}
|
virtual ~base_class() = default;
|
||||||
virtual void f1( int, int, int, int, int, int, int, int, int ) = 0;
|
virtual void f1( int, int, int, int, int, int, int, int, int ) = 0;
|
||||||
virtual void f2( int, int, int, int, int, int, int, int, int ) = 0;
|
virtual void f2( int, int, int, int, int, int, int, int, int ) = 0;
|
||||||
virtual void f3( int, int, int, int, int, int, int, int, int ) = 0;
|
virtual void f3( int, int, int, int, int, int, int, int, int ) = 0;
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ namespace
|
||||||
class base_class
|
class base_class
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual ~base_class() {}
|
virtual ~base_class() = default;
|
||||||
virtual void f1( int, int, int, int, int, int, int, int, int ) = 0;
|
virtual void f1( int, int, int, int, int, int, int, int, int ) = 0;
|
||||||
virtual void f2( int, int, int, int, int, int, int, int, int ) = 0;
|
virtual void f2( int, int, int, int, int, int, int, int, int ) = 0;
|
||||||
virtual void f3( int, int, int, int, int, int, int, int, int ) = 0;
|
virtual void f3( int, int, int, int, int, int, int, int, int ) = 0;
|
||||||
|
|
|
||||||
|
|
@ -289,10 +289,14 @@ BOOST_FIXTURE_TEST_CASE( triggering_an_expectation_with_wrong_parameter_value_in
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
class my_interface : boost::noncopyable
|
class my_interface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual ~my_interface() {}
|
my_interface() = default;
|
||||||
|
my_interface(const my_interface&) = delete;
|
||||||
|
my_interface& operator=(const my_interface&) = delete;
|
||||||
|
virtual ~my_interface() = default;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
virtual void my_method() = 0;
|
virtual void my_method() = 0;
|
||||||
};
|
};
|
||||||
|
|
@ -493,8 +497,7 @@ namespace
|
||||||
{
|
{
|
||||||
struct base
|
struct base
|
||||||
{
|
{
|
||||||
virtual ~base()
|
virtual ~base() = default;
|
||||||
{}
|
|
||||||
virtual void f() = 0;
|
virtual void f() = 0;
|
||||||
};
|
};
|
||||||
struct derived : base
|
struct derived : base
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ namespace
|
||||||
{
|
{
|
||||||
struct my_base
|
struct my_base
|
||||||
{
|
{
|
||||||
virtual ~my_base() {}
|
virtual ~my_base() = default;
|
||||||
virtual void my_method() = 0;
|
virtual void my_method() = 0;
|
||||||
virtual void my_method( int ) = 0;
|
virtual void my_method( int ) = 0;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ namespace
|
||||||
{
|
{
|
||||||
struct my_base
|
struct my_base
|
||||||
{
|
{
|
||||||
virtual ~my_base() {}
|
virtual ~my_base() = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
MOCK_BASE_CLASS( my_class, my_base )
|
MOCK_BASE_CLASS( my_class, my_base )
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ namespace
|
||||||
{
|
{
|
||||||
struct my_base
|
struct my_base
|
||||||
{
|
{
|
||||||
virtual ~my_base() {}
|
virtual ~my_base() = default;
|
||||||
virtual void my_method( int, int, int, int, int, int, int, int, int, int ) = 0;
|
virtual void my_method( int, int, int, int, int, int, int, int, int, int ) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ namespace
|
||||||
{
|
{
|
||||||
struct my_base
|
struct my_base
|
||||||
{
|
{
|
||||||
virtual ~my_base() {}
|
virtual ~my_base() = default;
|
||||||
virtual void my_method( int ) = 0;
|
virtual void my_method( int ) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,6 @@
|
||||||
#include "undefined.hpp"
|
#include "undefined.hpp"
|
||||||
#include <turtle/mock.hpp>
|
#include <turtle/mock.hpp>
|
||||||
#include <boost/test/auto_unit_test.hpp>
|
#include <boost/test/auto_unit_test.hpp>
|
||||||
#include <boost/noncopyable.hpp>
|
|
||||||
#include <boost/optional.hpp>
|
#include <boost/optional.hpp>
|
||||||
#include <boost/ref.hpp>
|
#include <boost/ref.hpp>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
|
@ -82,11 +81,13 @@ BOOST_FIXTURE_TEST_CASE( basic_mock_object_usage, mock_error_fixture )
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
class my_ambiguited_interface : boost::noncopyable
|
class my_ambiguited_interface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual ~my_ambiguited_interface()
|
my_ambiguited_interface() = default;
|
||||||
{}
|
my_ambiguited_interface(const my_ambiguited_interface&) = delete;
|
||||||
|
my_ambiguited_interface& operator=(const my_ambiguited_interface&) = delete;
|
||||||
|
virtual ~my_ambiguited_interface() = default;
|
||||||
virtual void my_method() = 0;
|
virtual void my_method() = 0;
|
||||||
virtual void my_method( int ) = 0;
|
virtual void my_method( int ) = 0;
|
||||||
};
|
};
|
||||||
|
|
@ -108,11 +109,13 @@ BOOST_FIXTURE_TEST_CASE( mock_object_method_disambiguation, mock_error_fixture )
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
class my_const_ambiguited_interface : boost::noncopyable
|
class my_const_ambiguited_interface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual ~my_const_ambiguited_interface()
|
my_const_ambiguited_interface() = default;
|
||||||
{}
|
my_const_ambiguited_interface(const my_const_ambiguited_interface&) = delete;
|
||||||
|
my_const_ambiguited_interface& operator=(const my_const_ambiguited_interface&) = delete;
|
||||||
|
virtual ~my_const_ambiguited_interface() = default;
|
||||||
virtual void my_method() = 0;
|
virtual void my_method() = 0;
|
||||||
virtual void my_method() const = 0;
|
virtual void my_method() const = 0;
|
||||||
};
|
};
|
||||||
|
|
@ -213,8 +216,7 @@ namespace
|
||||||
template< typename T >
|
template< typename T >
|
||||||
struct my_template_base_class
|
struct my_template_base_class
|
||||||
{
|
{
|
||||||
virtual ~my_template_base_class()
|
virtual ~my_template_base_class() = default;
|
||||||
{}
|
|
||||||
virtual void my_method( T ) = 0;
|
virtual void my_method( T ) = 0;
|
||||||
virtual void my_other_method() = 0;
|
virtual void my_other_method() = 0;
|
||||||
};
|
};
|
||||||
|
|
@ -237,23 +239,27 @@ BOOST_FIXTURE_TEST_CASE( mocking_a_template_base_class_method_is_supported, mock
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
class my_observer : boost::noncopyable
|
class my_observer
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual ~my_observer()
|
my_observer() = default;
|
||||||
{}
|
my_observer(const my_observer&) = delete;
|
||||||
|
my_observer& operator=(const my_observer&) = delete;
|
||||||
|
virtual ~my_observer() = default;
|
||||||
virtual void notify( int value ) = 0;
|
virtual void notify( int value ) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
class my_manager : boost::noncopyable
|
class my_manager
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual ~my_manager()
|
my_manager() = default;
|
||||||
{}
|
my_manager(const my_manager&) = delete;
|
||||||
|
my_manager& operator=(const my_manager&) = delete;
|
||||||
|
virtual ~my_manager() = default;
|
||||||
virtual my_observer& get_observer() const = 0;
|
virtual my_observer& get_observer() const = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
class my_subject : boost::noncopyable
|
class my_subject
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit my_subject( my_manager& f )
|
explicit my_subject( my_manager& f )
|
||||||
|
|
|
||||||
|
|
@ -360,8 +360,7 @@ namespace
|
||||||
{
|
{
|
||||||
struct base
|
struct base
|
||||||
{
|
{
|
||||||
virtual ~base()
|
virtual ~base() = default;
|
||||||
{}
|
|
||||||
|
|
||||||
virtual void m1() = 0;
|
virtual void m1() = 0;
|
||||||
virtual void m10() const = 0;
|
virtual void m10() const = 0;
|
||||||
|
|
@ -417,8 +416,7 @@ namespace stdcall
|
||||||
{
|
{
|
||||||
struct base
|
struct base
|
||||||
{
|
{
|
||||||
virtual ~base()
|
virtual ~base() = default;
|
||||||
{}
|
|
||||||
|
|
||||||
virtual void MOCK_STDCALL m1() = 0;
|
virtual void MOCK_STDCALL m1() = 0;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue