mirror of
https://github.com/mat007/turtle.git
synced 2026-06-22 12:13:43 +00:00
Refactored to introduce MOCK_NULLPTR
git-svn-id: https://svn.code.sf.net/p/turtle/code/trunk@672 860be788-9bd5-4423-9f1e-828f051e677b
This commit is contained in:
parent
5c82c8052f
commit
4f5090c109
6 changed files with 13 additions and 6 deletions
|
|
@ -349,7 +349,7 @@ BOOST_FIXTURE_TEST_CASE( triggering_an_expectation_with_failing_custom_constrain
|
||||||
// CHECK_CALLS( 1 );
|
// CHECK_CALLS( 1 );
|
||||||
//}
|
//}
|
||||||
|
|
||||||
#if !defined(BOOST_NO_CXX11_NULLPTR) && !defined(BOOST_NO_NULLPTR)
|
#ifdef MOCK_NULLPTR
|
||||||
|
|
||||||
BOOST_FIXTURE_TEST_CASE( nullptr_can_be_used_in_place_of_null_pointers_in_constraints, error_fixture )
|
BOOST_FIXTURE_TEST_CASE( nullptr_can_be_used_in_place_of_null_pointers_in_constraints, error_fixture )
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -78,7 +78,7 @@ BOOST_AUTO_TEST_CASE( same_constraint )
|
||||||
BOOST_CHECK( ! c.c_( j ) );
|
BOOST_CHECK( ! c.c_( j ) );
|
||||||
BOOST_CHECK( c.c_( i ) );
|
BOOST_CHECK( c.c_( i ) );
|
||||||
}
|
}
|
||||||
#if !defined(BOOST_NO_CXX11_NULLPTR) && !defined(BOOST_NO_NULLPTR)
|
#ifdef MOCK_NULLPTR
|
||||||
{
|
{
|
||||||
std::nullptr_t p;
|
std::nullptr_t p;
|
||||||
BOOST_CHECK( mock::same( p ).c_( p ) );
|
BOOST_CHECK( mock::same( p ).c_( p ) );
|
||||||
|
|
@ -211,7 +211,7 @@ BOOST_AUTO_TEST_CASE( retrieve_constraint )
|
||||||
BOOST_CHECK( mock::retrieve( boost::ref( i ) ).c_( j ) );
|
BOOST_CHECK( mock::retrieve( boost::ref( i ) ).c_( j ) );
|
||||||
BOOST_CHECK_EQUAL( i, &j );
|
BOOST_CHECK_EQUAL( i, &j );
|
||||||
}
|
}
|
||||||
#if !defined(BOOST_NO_CXX11_NULLPTR) && !defined(BOOST_NO_NULLPTR)
|
#ifdef MOCK_NULLPTR
|
||||||
{
|
{
|
||||||
std::nullptr_t* i = 0;
|
std::nullptr_t* i = 0;
|
||||||
std::nullptr_t j;
|
std::nullptr_t j;
|
||||||
|
|
|
||||||
|
|
@ -631,7 +631,7 @@ BOOST_AUTO_TEST_CASE( boost_lambda_functor_yields_question_mark_when_serialized
|
||||||
BOOST_CHECK_EQUAL( "?", to_string( boost::lambda::_1 < 42 ) );
|
BOOST_CHECK_EQUAL( "?", to_string( boost::lambda::_1 < 42 ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(BOOST_NO_CXX11_NULLPTR) && !defined(BOOST_NO_NULLPTR)
|
#ifdef MOCK_NULLPTR
|
||||||
|
|
||||||
BOOST_AUTO_TEST_CASE( nullptr_is_serialized )
|
BOOST_AUTO_TEST_CASE( nullptr_is_serialized )
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -53,6 +53,12 @@
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if !defined(BOOST_NO_CXX11_NULLPTR) && !defined(BOOST_NO_NULLPTR)
|
||||||
|
# ifndef MOCK_NO_NULLPTR
|
||||||
|
# define MOCK_NULLPTR
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#if !defined(BOOST_NO_CXX11_DECLTYPE) && !defined(BOOST_NO_DECLTYPE)
|
#if !defined(BOOST_NO_CXX11_DECLTYPE) && !defined(BOOST_NO_DECLTYPE)
|
||||||
# ifndef MOCK_NO_DECLTYPE
|
# ifndef MOCK_NO_DECLTYPE
|
||||||
# define MOCK_DECLTYPE
|
# define MOCK_DECLTYPE
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@
|
||||||
#ifndef MOCK_ADDRESSOF_HPP_INCLUDED
|
#ifndef MOCK_ADDRESSOF_HPP_INCLUDED
|
||||||
#define MOCK_ADDRESSOF_HPP_INCLUDED
|
#define MOCK_ADDRESSOF_HPP_INCLUDED
|
||||||
|
|
||||||
|
#include "../config.hpp"
|
||||||
#include <boost/utility/addressof.hpp>
|
#include <boost/utility/addressof.hpp>
|
||||||
|
|
||||||
namespace mock
|
namespace mock
|
||||||
|
|
@ -17,7 +18,7 @@ namespace detail
|
||||||
{
|
{
|
||||||
using boost::addressof;
|
using boost::addressof;
|
||||||
|
|
||||||
#if !defined(BOOST_NO_CXX11_NULLPTR) && !defined(BOOST_NO_NULLPTR)
|
#ifdef MOCK_NULLPTR
|
||||||
|
|
||||||
inline const std::nullptr_t* addressof( const std::nullptr_t& p )
|
inline const std::nullptr_t* addressof( const std::nullptr_t& p )
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -137,7 +137,7 @@ namespace detail
|
||||||
{
|
{
|
||||||
return s << '?';
|
return s << '?';
|
||||||
}
|
}
|
||||||
#if !defined(BOOST_NO_CXX11_NULLPTR) && !defined(BOOST_NO_NULLPTR)
|
#ifdef MOCK_NULLPTR
|
||||||
inline stream& operator<<( stream& s, std::nullptr_t )
|
inline stream& operator<<( stream& s, std::nullptr_t )
|
||||||
{
|
{
|
||||||
return s << "nullptr";
|
return s << "nullptr";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue