mirror of
https://github.com/catchorg/Catch2.git
synced 2025-06-03 18:37:56 +00:00
Added NotImplementedException
This commit is contained in:
parent
4c73aa5a0e
commit
abf271672f
7 changed files with 252 additions and 195 deletions
|
@ -19,6 +19,30 @@ namespace Catch {
|
|||
|
||||
struct TestFailureException{};
|
||||
|
||||
class NotImplementedException : public std::exception
|
||||
{
|
||||
public:
|
||||
NotImplementedException( const SourceLineInfo& lineInfo )
|
||||
: m_lineInfo( lineInfo ) {
|
||||
std::ostringstream oss;
|
||||
oss << lineInfo << "function ";
|
||||
if( !lineInfo.function.empty() )
|
||||
oss << lineInfo.function << " ";
|
||||
oss << "not implemented";
|
||||
m_what = oss.str();
|
||||
}
|
||||
|
||||
virtual ~NotImplementedException() throw() {}
|
||||
|
||||
virtual const char* what() const throw() {
|
||||
return m_what.c_str();
|
||||
}
|
||||
|
||||
private:
|
||||
std::string m_what;
|
||||
SourceLineInfo m_lineInfo;
|
||||
};
|
||||
|
||||
class ScopedInfo {
|
||||
public:
|
||||
ScopedInfo() : m_oss() {
|
||||
|
@ -130,4 +154,7 @@ inline bool isTrue( bool value ){ return value; }
|
|||
throw; \
|
||||
}}while( Catch::isTrue( false ) )
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
#define CATCH_NOT_IMPLEMENTED throw Catch::NotImplementedException( CATCH_INTERNAL_LINEINFO )
|
||||
|
||||
#endif // TWOBLUECUBES_CATCH_CAPTURE_HPP_INCLUDED
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue