mirror of
https://github.com/mat007/turtle.git
synced 2026-06-22 12:13:43 +00:00
Prevented a crash when mocking a destructor and throwing out of the object scope
git-svn-id: https://svn.code.sf.net/p/turtle/code/trunk@121 860be788-9bd5-4423-9f1e-828f051e677b
This commit is contained in:
parent
456869d82b
commit
0e8079d47a
8 changed files with 174 additions and 113 deletions
|
|
@ -25,20 +25,18 @@ namespace mock
|
|||
return s.str();
|
||||
}
|
||||
|
||||
static Result no_match( const std::string& context )
|
||||
static Result abort()
|
||||
{
|
||||
throw std::runtime_error( "no_match : " + context );
|
||||
}
|
||||
static Result missing_result_specification( const std::string& context,
|
||||
const std::string& file, int line )
|
||||
{
|
||||
throw std::runtime_error( "missing_result_specification : " + context + " " + file + "(" + to_string( line ) + ")" );
|
||||
}
|
||||
static void sequence_failed( const std::string& context,
|
||||
const std::string& file, int line )
|
||||
{
|
||||
throw std::runtime_error( "sequence_failed : " + context + " " + file + "(" + to_string( line ) + ")" );
|
||||
throw std::runtime_error( "abort" );
|
||||
}
|
||||
static void no_match( const std::string& /*context*/ )
|
||||
{}
|
||||
static void missing_action( const std::string& /*context*/,
|
||||
const std::string& /*file*/, int /*line*/ )
|
||||
{}
|
||||
static void sequence_failed( const std::string& /*context*/,
|
||||
const std::string& /*file*/, int /*line*/ )
|
||||
{}
|
||||
static void verification_failed( const std::string& /*context*/,
|
||||
const std::string& /*file*/, int /*line*/ )
|
||||
{}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue