mirror of
https://github.com/mat007/turtle.git
synced 2026-06-22 12:13:43 +00:00
Error policy now customizable and missing result specifications now reported with file name and line
git-svn-id: https://svn.code.sf.net/p/turtle/code/trunk@67 860be788-9bd5-4423-9f1e-828f051e677b
This commit is contained in:
parent
51379e7844
commit
6ff9fc5564
14 changed files with 380 additions and 271 deletions
43
src/tests/turtle_test/silent_error.hpp
Normal file
43
src/tests/turtle_test/silent_error.hpp
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
//
|
||||
// Copyright Mathieu Champlon 2008
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
#ifndef MOCK_TEST_SILENT_ERROR_HPP_INCLUDED
|
||||
#define MOCK_TEST_SILENT_ERROR_HPP_INCLUDED
|
||||
|
||||
#include <string>
|
||||
#include <exception>
|
||||
|
||||
namespace mock
|
||||
{
|
||||
template< typename Result >
|
||||
struct silent_error
|
||||
{
|
||||
static Result no_match( const std::string& /*context*/ )
|
||||
{
|
||||
throw std::exception();
|
||||
}
|
||||
static Result missing_result_specification( const std::string& /*context*/,
|
||||
const std::string& /*file*/, int /*line*/ )
|
||||
{
|
||||
throw std::exception();
|
||||
}
|
||||
static void sequence_failed( const std::string& /*context*/,
|
||||
const std::string& /*file*/, int /*line*/ )
|
||||
{
|
||||
throw std::exception();
|
||||
}
|
||||
static void verification_failed( const std::string& /*context*/,
|
||||
const std::string& /*file*/, int /*line*/ )
|
||||
{}
|
||||
static void untriggered_expectation( const std::string& /*context*/,
|
||||
const std::string& /*file*/, int /*line*/ )
|
||||
{}
|
||||
};
|
||||
}
|
||||
|
||||
#endif // #ifndef MOCK_TEST_SILENT_ERROR_HPP_INCLUDED
|
||||
Loading…
Add table
Add a link
Reference in a new issue