Use CATCH_NULL instead of NULL

- expands to nullptr if CATCH_CONFIG_CPP11_NULLPTR is defined (see #444)
This commit is contained in:
Phil Nash 2015-07-01 07:33:27 +01:00
parent 3b18d9e962
commit 805de43a3d
25 changed files with 112 additions and 101 deletions

View file

@ -124,13 +124,13 @@ TEST_CASE( "Sends stuff to stdout and stderr", "[.]" )
inline const char* makeString( bool makeNull )
{
return makeNull ? NULL : "valid string";
return makeNull ? CATCH_NULL : "valid string";
}
TEST_CASE( "null strings", "" )
{
REQUIRE( makeString( false ) != static_cast<char*>(NULL));
REQUIRE( makeString( true ) == static_cast<char*>(NULL));
REQUIRE( makeString( false ) != static_cast<char*>(CATCH_NULL));
REQUIRE( makeString( true ) == static_cast<char*>(CATCH_NULL));
}
@ -233,7 +233,7 @@ TEST_CASE("Equals string matcher", "[.][failing][matchers]")
}
TEST_CASE("Equals string matcher, with NULL", "[matchers]")
{
REQUIRE_THAT("", Equals(NULL));
REQUIRE_THAT("", Equals(CATCH_NULL));
}
TEST_CASE("AllOf matcher", "[matchers]")
{