mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-04 05:09:53 +01:00
Fix for #179
This commit is contained in:
parent
ba9b2b5a37
commit
066a6388d6
@ -86,7 +86,8 @@ struct StringMaker :
|
|||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
struct StringMaker<T*> {
|
struct StringMaker<T*> {
|
||||||
static std::string convert( T const* p ) {
|
template<typename U>
|
||||||
|
static std::string convert( U* p ) {
|
||||||
if( !p )
|
if( !p )
|
||||||
return INTERNAL_CATCH_STRINGIFY( NULL );
|
return INTERNAL_CATCH_STRINGIFY( NULL );
|
||||||
std::ostringstream oss;
|
std::ostringstream oss;
|
||||||
|
@ -342,6 +342,28 @@ TEST_CASE( "non streamable - with conv. op", "" )
|
|||||||
REQUIRE( s == "7" );
|
REQUIRE( s == "7" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline void foo() {}
|
||||||
|
|
||||||
|
typedef void (*fooptr_t)();
|
||||||
|
|
||||||
|
TEST_CASE( "Comparing function pointers", "[function pointer]" )
|
||||||
|
{
|
||||||
|
// This was giving a warning in VS2010
|
||||||
|
// #179
|
||||||
|
fooptr_t a = foo;
|
||||||
|
|
||||||
|
REQUIRE( a );
|
||||||
|
REQUIRE( a == &foo );
|
||||||
|
}
|
||||||
|
|
||||||
|
class ClassName {};
|
||||||
|
|
||||||
|
TEST_CASE( "pointer to class", "" )
|
||||||
|
{
|
||||||
|
ClassName *p = 0;
|
||||||
|
REQUIRE( p != 0 );
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef CATCH_CONFIG_CPP11_NULLPTR
|
#ifdef CATCH_CONFIG_CPP11_NULLPTR
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
Loading…
Reference in New Issue
Block a user