include/cppunit/Asserter.h | 12 ++++++------ src/cppunit/Asserter.cpp | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-)
New commits: commit a60124f6dbca67e01bd09047545a0eb767565383 Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Sat Jan 6 19:21:45 2024 +0000 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Sat Jan 6 20:28:52 2024 +0100 cid#1545475 COPY_INSTEAD_OF_MOVE and cid#1545626 COPY_INSTEAD_OF_MOVE cid#1546203 COPY_INSTEAD_OF_MOVE Change-Id: I9df8f30d1102a9fd5247c9efe44be9e3268277bd Reviewed-on: https://gerrit.libreoffice.org/c/cppunit/+/161717 Tested-by: Caolán McNamara <caolan.mcnam...@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> diff --git a/include/cppunit/Asserter.h b/include/cppunit/Asserter.h index ca65593..2010739 100644 --- a/include/cppunit/Asserter.h +++ b/include/cppunit/Asserter.h @@ -159,11 +159,11 @@ struct Asserter * what are the differences between the expected and actual value. * \param shortDescription Short description for the failure message. */ - [[noreturn]] static void CPPUNIT_API failNotEqual( std::string expected, - std::string actual, + [[noreturn]] static void CPPUNIT_API failNotEqual( const std::string& expected, + const std::string& actual, const SourceLine &sourceLine, const AdditionalMessage &additionalMessage = AdditionalMessage(), - std::string shortDescription = "equality assertion failed" ); + const std::string& shortDescription = "equality assertion failed" ); /*! rief Throws an Exception with the specified message and location. * \param expected Text describing the expected value. @@ -231,11 +231,11 @@ struct Asserter * \param shortDescription Short description for the failure message. */ static void CPPUNIT_API failNotEqualIf( bool shouldFail, - std::string expected, - std::string actual, + const std::string& expected, + const std::string& actual, const SourceLine &sourceLine, const AdditionalMessage &additionalMessage = AdditionalMessage(), - std::string shortDescription = "equality assertion failed" ); + const std::string& shortDescription = "equality assertion failed" ); }; diff --git a/src/cppunit/Asserter.cpp b/src/cppunit/Asserter.cpp index 52f8625..fe2097e 100644 --- a/src/cppunit/Asserter.cpp +++ b/src/cppunit/Asserter.cpp @@ -110,11 +110,11 @@ Asserter::makeNotEqualMessage( const std::string &expectedValue, void -Asserter::failNotEqual( std::string expected, - std::string actual, +Asserter::failNotEqual( const std::string& expected, + const std::string& actual, const SourceLine &sourceLine, const AdditionalMessage &additionalMessage, - std::string shortDescription ) + const std::string& shortDescription ) { fail( makeMessage( makeExpectedEqual(expected), makeActual(actual), @@ -182,11 +182,11 @@ Asserter::failNotGreaterEqual( std::string expected, } void Asserter::failNotEqualIf( bool shouldFail, - std::string expected, - std::string actual, + const std::string& expected, + const std::string& actual, const SourceLine &sourceLine, const AdditionalMessage &additionalMessage, - std::string shortDescription ) + const std::string& shortDescription ) { if ( shouldFail ) failNotEqual( expected, actual, sourceLine, additionalMessage, shortDescription );