mirror of
https://github.com/catchorg/Catch2.git
synced 2025-05-25 14:09:26 +00:00
First cut of StaticRegistries - separate from Context
This commit is contained in:
parent
5234b15ff4
commit
1091ca81e6
21 changed files with 222 additions and 141 deletions
|
@ -9,6 +9,7 @@
|
|||
#define TWOBLUECUBES_CATCH_INTERFACES_EXCEPTIONS_H_INCLUDED
|
||||
|
||||
#include <string>
|
||||
#include "catch_interfaces_static_registries.h"
|
||||
|
||||
namespace Catch {
|
||||
|
||||
|
@ -22,7 +23,6 @@ namespace Catch {
|
|||
struct IExceptionTranslatorRegistry {
|
||||
virtual ~IExceptionTranslatorRegistry(){}
|
||||
|
||||
virtual void registerTranslator( IExceptionTranslator* translator ) = 0;
|
||||
virtual std::string translateActiveException() const = 0;
|
||||
};
|
||||
|
||||
|
@ -51,7 +51,7 @@ namespace Catch {
|
|||
public:
|
||||
template<typename T>
|
||||
ExceptionTranslatorRegistrar( std::string(*translateFunction)( T& ) ) {
|
||||
getCurrentContext().getExceptionTranslatorRegistry().registerTranslator
|
||||
getStaticRegistries().registerTranslator
|
||||
( new ExceptionTranslator<T>( translateFunction ) );
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue