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:
mat007 2010-02-15 22:59:23 +00:00
parent 456869d82b
commit 0e8079d47a
8 changed files with 174 additions and 113 deletions

View file

@ -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*/ )
{}