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

@ -17,7 +17,7 @@ namespace Catch {
class Context : public IMutableContext {
Context() : m_config( NULL ), m_runner( NULL ), m_resultCapture( NULL ) {}
Context() : m_config( CATCH_NULL ), m_runner( CATCH_NULL ), m_resultCapture( CATCH_NULL ) {}
Context( Context const& );
void operator=( Context const& );
@ -63,7 +63,7 @@ namespace Catch {
m_generatorsByTestName.find( testName );
return it != m_generatorsByTestName.end()
? it->second
: NULL;
: CATCH_NULL;
}
IGeneratorsForTest& getGeneratorsForCurrentTest() {
@ -84,7 +84,7 @@ namespace Catch {
};
namespace {
Context* currentContext = NULL;
Context* currentContext = CATCH_NULL;
}
IMutableContext& getCurrentMutableContext() {
if( !currentContext )
@ -105,7 +105,7 @@ namespace Catch {
void cleanUpContext() {
delete currentContext;
currentContext = NULL;
currentContext = CATCH_NULL;
}
}