mirror of
https://github.com/catchorg/Catch2.git
synced 2025-09-23 13:05:39 +02:00
Code review changes to fix missing default ctor initialisation
This commit is contained in:
@@ -15,7 +15,7 @@ namespace Catch {
|
||||
|
||||
struct AssertionInfo
|
||||
{
|
||||
AssertionInfo() {}
|
||||
AssertionInfo() : macroName(nullptr), capturedExpression(nullptr) {}
|
||||
AssertionInfo( char const * _macroName,
|
||||
SourceLineInfo const& _lineInfo,
|
||||
char const * _capturedExpression,
|
||||
|
@@ -47,7 +47,7 @@ namespace Catch {
|
||||
}
|
||||
|
||||
bool AssertionResult::hasExpression() const {
|
||||
return m_info.capturedExpression != 0 && *m_info.capturedExpression != 0;
|
||||
return m_info.capturedExpression && *m_info.capturedExpression;
|
||||
}
|
||||
|
||||
bool AssertionResult::hasMessage() const {
|
||||
@@ -61,7 +61,7 @@ namespace Catch {
|
||||
return m_info.capturedExpression;
|
||||
}
|
||||
std::string AssertionResult::getExpressionInMacro() const {
|
||||
if( m_info.macroName == 0 || *m_info.macroName == 0)
|
||||
if( m_info.macroName == nullptr || *m_info.macroName == 0)
|
||||
return m_info.capturedExpression;
|
||||
else
|
||||
return std::string(m_info.macroName) + "( " + m_info.capturedExpression + " )";
|
||||
|
@@ -104,7 +104,7 @@ namespace Catch {
|
||||
|
||||
struct SourceLineInfo {
|
||||
|
||||
SourceLineInfo() : line( 0 ){}
|
||||
SourceLineInfo() : file( nullptr ), line( 0 ){}
|
||||
SourceLineInfo( char const * _file, std::size_t _line )
|
||||
: file( _file ),
|
||||
line( _line )
|
||||
@@ -114,7 +114,7 @@ namespace Catch {
|
||||
line( other.line )
|
||||
{}
|
||||
bool empty() const {
|
||||
return file == 0 || *file == 0;
|
||||
return file == nullptr || *file == 0;
|
||||
}
|
||||
bool operator == ( SourceLineInfo const& other ) const {
|
||||
return line == other.line && ((empty() && other.empty()) || strcmp(file, other.file) == 0);
|
||||
|
@@ -13,7 +13,7 @@
|
||||
namespace Catch {
|
||||
|
||||
// These numbers are maintained by a script
|
||||
Version libraryVersion( 1, 0, 11, "master" );
|
||||
Version libraryVersion( 1, 0, 12, "master" );
|
||||
}
|
||||
|
||||
#endif // TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED
|
||||
|
Reference in New Issue
Block a user