summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Becker <fb@vxapps.com>2021-10-01 02:15:52 +0800
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2021-10-01 02:15:52 +0800
commit89c831e25ab566756288c45e5505815e9185b276 (patch)
tree21e289d9700a3bcd77b204b9d58fbf4e1eb0db68
parent3836794be3e10b8a65f666f07fa721c7ea205a17 (diff)
downloadcppunit-89c831e25ab566756288c45e5505815e9185b276.tar.gz
add missing [[noreturn]] attributes
-rw-r--r--include/cppunit/Asserter.h40
-rw-r--r--src/cppunit/Asserter.cpp12
2 files changed, 26 insertions, 26 deletions
diff --git a/include/cppunit/Asserter.h b/include/cppunit/Asserter.h
index dd39ead..8858688 100644
--- a/include/cppunit/Asserter.h
+++ b/include/cppunit/Asserter.h
@@ -173,11 +173,11 @@ struct Asserter
* what are the differences between the expected and actual value.
* \param shortDescription Short description for the failure message.
*/
- static void CPPUNIT_API failNotLess( std::string expected,
- std::string actual,
- const SourceLine &sourceLine,
- const AdditionalMessage &additionalMessage = AdditionalMessage(),
- std::string shortDescription = "less assertion failed" );
+ [[noreturn]] static void CPPUNIT_API failNotLess( std::string expected,
+ std::string actual,
+ const SourceLine &sourceLine,
+ const AdditionalMessage &additionalMessage = AdditionalMessage(),
+ std::string shortDescription = "less assertion failed" );
/*! \brief Throws an Exception with the specified message and location.
* \param expected Text describing the expected value.
@@ -187,11 +187,11 @@ struct Asserter
* what are the differences between the expected and actual value.
* \param shortDescription Short description for the failure message.
*/
- static void CPPUNIT_API failNotGreater( std::string expected,
- std::string actual,
- const SourceLine &sourceLine,
- const AdditionalMessage &additionalMessage = AdditionalMessage(),
- std::string shortDescription = "greater assertion failed" );
+ [[noreturn]] static void CPPUNIT_API failNotGreater( std::string expected,
+ std::string actual,
+ const SourceLine &sourceLine,
+ const AdditionalMessage &additionalMessage = AdditionalMessage(),
+ std::string shortDescription = "greater assertion failed" );
/*! \brief Throws an Exception with the specified message and location.
* \param expected Text describing the expected value.
@@ -201,11 +201,11 @@ struct Asserter
* what are the differences between the expected and actual value.
* \param shortDescription Short description for the failure message.
*/
- static void CPPUNIT_API failNotLessEqual( std::string expected,
- std::string actual,
- const SourceLine &sourceLine,
- const AdditionalMessage &additionalMessage = AdditionalMessage(),
- std::string shortDescription = "less equal assertion failed" );
+ [[noreturn]] static void CPPUNIT_API failNotLessEqual( std::string expected,
+ std::string actual,
+ const SourceLine &sourceLine,
+ const AdditionalMessage &additionalMessage = AdditionalMessage(),
+ std::string shortDescription = "less equal assertion failed" );
/*! \brief Throws an Exception with the specified message and location.
* \param expected Text describing the expected value.
@@ -215,11 +215,11 @@ struct Asserter
* what are the differences between the expected and actual value.
* \param shortDescription Short description for the failure message.
*/
- static void CPPUNIT_API failNotGreaterEqual( std::string expected,
- std::string actual,
- const SourceLine &sourceLine,
- const AdditionalMessage &additionalMessage = AdditionalMessage(),
- std::string shortDescription = "greater equal assertion failed" ); /*! \brief Throws an Exception with the specified message and location.
+ [[noreturn]] static void CPPUNIT_API failNotGreaterEqual( std::string expected,
+ std::string actual,
+ const SourceLine &sourceLine,
+ const AdditionalMessage &additionalMessage = AdditionalMessage(),
+ std::string shortDescription = "greater equal assertion failed" ); /*! \brief Throws an Exception with the specified message and location.
* \param shouldFail if \c true then the exception is thrown. Otherwise
* nothing happen.
diff --git a/src/cppunit/Asserter.cpp b/src/cppunit/Asserter.cpp
index 79fcb2e..9e74f1d 100644
--- a/src/cppunit/Asserter.cpp
+++ b/src/cppunit/Asserter.cpp
@@ -7,7 +7,7 @@ CPPUNIT_NS_BEGIN
// coverity[+kill]
-void
+[[noreturn]] void
Asserter::fail( std::string message,
const SourceLine &sourceLine )
{
@@ -15,7 +15,7 @@ Asserter::fail( std::string message,
}
// coverity[+kill]
-void
+[[noreturn]] void
Asserter::fail( const Message &message,
const SourceLine &sourceLine )
{
@@ -124,7 +124,7 @@ Asserter::failNotEqual( std::string expected,
}
-void
+[[noreturn]] void
Asserter::failNotLess( std::string expected,
std::string actual,
const SourceLine &sourceLine,
@@ -139,7 +139,7 @@ Asserter::failNotLess( std::string expected,
}
-void
+[[noreturn]] void
Asserter::failNotGreater( std::string expected,
std::string actual,
const SourceLine &sourceLine,
@@ -153,7 +153,7 @@ Asserter::failNotGreater( std::string expected,
sourceLine );
}
-void
+[[noreturn]] void
Asserter::failNotLessEqual( std::string expected,
std::string actual,
const SourceLine &sourceLine,
@@ -167,7 +167,7 @@ Asserter::failNotLessEqual( std::string expected,
sourceLine );
}
-void
+[[noreturn]] void
Asserter::failNotGreaterEqual( std::string expected,
std::string actual,
const SourceLine &sourceLine,