From b323536096648cf1a869ca7446a1b0778096bcbc Mon Sep 17 00:00:00 2001 From: mat007 Date: Sat, 1 Sep 2012 22:41:58 +0000 Subject: [PATCH] Reverted 547,548 git-svn-id: https://svn.code.sf.net/p/turtle/code/trunk@549 860be788-9bd5-4423-9f1e-828f051e677b --- test/detail/test_check.cpp | 35 ----------------------------------- turtle/detail/check.hpp | 21 --------------------- 2 files changed, 56 deletions(-) diff --git a/test/detail/test_check.cpp b/test/detail/test_check.cpp index a2d8eb6..fe30012 100644 --- a/test/detail/test_check.cpp +++ b/test/detail/test_check.cpp @@ -30,38 +30,3 @@ BOOST_AUTO_TEST_CASE( ref_to_int_and_int_can_be_compared ) BOOST_CHECK( check( 3, boost::cref( 3 ) ) ); BOOST_CHECK( ! check( 4, boost::cref( 3 ) ) ); } - -namespace -{ - struct fixture - { - fixture() - : actual( "!same text" + 1 ) - { - const char* static_string = "same text"; - BOOST_REQUIRE( actual != static_string ); - BOOST_REQUIRE( actual == std::string( static_string ) ); - } - const char* actual; - }; -} - -BOOST_FIXTURE_TEST_CASE( const_char_pointer_and_const_char_pointer_can_be_compared, fixture ) -{ - const char* expected = "same text"; - BOOST_CHECK( check( expected, actual ) ); - const char* unexpected = "different text"; - BOOST_CHECK( ! check( actual, unexpected ) ); -} - -BOOST_FIXTURE_TEST_CASE( const_char_pointer_and_string_literal_can_be_compared, fixture ) -{ - BOOST_CHECK( check( "same text", actual ) ); - BOOST_CHECK( ! check( "different text", actual ) ); -} - -BOOST_FIXTURE_TEST_CASE( const_char_pointer_and_std_string_can_be_compared, fixture ) -{ - BOOST_CHECK( check( std::string( "same text" ), actual ) ); - BOOST_CHECK( ! check( std::string( "different text" ), actual ) ); -} diff --git a/turtle/detail/check.hpp b/turtle/detail/check.hpp index 0691ded..55f6054 100644 --- a/turtle/detail/check.hpp +++ b/turtle/detail/check.hpp @@ -15,7 +15,6 @@ #include #include #include -#include namespace mock { @@ -58,26 +57,6 @@ namespace detail Expected expected_; }; - template<> - class check< const char*, const char* > : public check_base< const char* > - { - public: - explicit check( const char* expected ) - : expected_( expected ) - {} - virtual bool operator()( const char* actual ) - { - return std::strcmp( actual, expected_ ) == 0; - } - private: - virtual void serialize( std::ostream& s ) const - { - s << mock::format( expected_ ); - } - private: - const char* expected_; - }; - template< typename Actual, typename Constraint > class check< Actual, mock::constraint< Constraint > > : public check_base< Actual >