From da25a3d1b254bcc272818d29c8ab6068b1203277 Mon Sep 17 00:00:00 2001 From: Craig Henderson Date: Sat, 12 Oct 2013 15:23:29 +0100 Subject: [PATCH] Code review changes to fix missing default ctor initialisation --- README.md | 2 +- include/internal/catch_assertionresult.h | 2 +- include/internal/catch_assertionresult.hpp | 4 ++-- include/internal/catch_common.h | 4 ++-- include/internal/catch_version.hpp | 2 +- single_include/catch.hpp | 16 ++++++++-------- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 24dc1b96..688a41f7 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ![catch logo](catch-logo-small.png) -*v1.0 build 11 (master branch)* +*v1.0 build 12 (master branch)* # New release with significant changes diff --git a/include/internal/catch_assertionresult.h b/include/internal/catch_assertionresult.h index 132d2cba..7d7056a4 100644 --- a/include/internal/catch_assertionresult.h +++ b/include/internal/catch_assertionresult.h @@ -15,7 +15,7 @@ namespace Catch { struct AssertionInfo { - AssertionInfo() {} + AssertionInfo() : macroName(nullptr), capturedExpression(nullptr) {} AssertionInfo( char const * _macroName, SourceLineInfo const& _lineInfo, char const * _capturedExpression, diff --git a/include/internal/catch_assertionresult.hpp b/include/internal/catch_assertionresult.hpp index 4d047e6e..1243d6d2 100644 --- a/include/internal/catch_assertionresult.hpp +++ b/include/internal/catch_assertionresult.hpp @@ -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 + " )"; diff --git a/include/internal/catch_common.h b/include/internal/catch_common.h index 9c35527e..cec062e5 100644 --- a/include/internal/catch_common.h +++ b/include/internal/catch_common.h @@ -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); diff --git a/include/internal/catch_version.hpp b/include/internal/catch_version.hpp index 2375e318..e2c02b66 100644 --- a/include/internal/catch_version.hpp +++ b/include/internal/catch_version.hpp @@ -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 diff --git a/single_include/catch.hpp b/single_include/catch.hpp index 50eb47d1..ecd32d11 100644 --- a/single_include/catch.hpp +++ b/single_include/catch.hpp @@ -1,6 +1,6 @@ /* - * CATCH v1.0 build 11 (master branch) - * Generated: 2013-10-12 10:11:15.393000 + * CATCH v1.0 build 12 (master branch) + * Generated: 2013-10-12 15:20:33.039000 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved. @@ -196,7 +196,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 ) @@ -206,7 +206,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); @@ -935,7 +935,7 @@ namespace Catch { struct AssertionInfo { - AssertionInfo() {} + AssertionInfo() : macroName(nullptr), capturedExpression(nullptr) {} AssertionInfo( char const * _macroName, SourceLineInfo const& _lineInfo, char const * _capturedExpression, @@ -6122,7 +6122,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 { @@ -6136,7 +6136,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 + " )"; @@ -6371,7 +6371,7 @@ namespace Catch { namespace Catch { // These numbers are maintained by a script - Version libraryVersion( 1, 0, 11, "master" ); + Version libraryVersion( 1, 0, 12, "master" ); } // #included from: catch_text.hpp